How to send html email with image background via PHPMailer?
I need standart html template with image backgrounds
It's not really up to PHPMailer, it's determined by the content you provide in the message body, but I'd suggest you stay away from image backgrounds anyway because Outlook does not support them.
Related
I am able to send emails with images using PHPMailer, but now I would like to rotate some of the images from landscape to portrait. Is it possible to rotate images using CSS in the email?
According to Campaign Monitor, the CSS transform:rotate() property is not supported in the majority of the top Desktop, Mobile, and Webmail email clients.
Instead, a more dependable method would be to simply rotate the images manually in advance, or use the PHP function imagerotate() to rotate the images to landscape programmatically before sending the email.
I made a laravel email client that displays emails as conversations, but the problem is how to restrict styles only for emails? Once I open an email with tags the whole email client's style changes. For example tags underlines and changes color. If I remove style or put !important to main css file then emails loose their original appearance.Any suggestions?
Personally I would use an iframe for rendering the email content. This way any styles/tags within the email content are restricted to the iframe only and the email is rendered as intended.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
php image display without download in mail
I have a PHP web application which create wishes card and send them with the PHP mail() function.
The wishes card is build with HTML and part of the card are illustrations, those illustrations use jpg images inside an IMG tag. The images are hosted on a server so images paths use a complete link (like http:/domain.com/img.jpg).
When the card is received, for exemple with thunderbird, it says images are blocked and the user has to click on a button to show the images.
I understand it's a security mesure.
That's still annoying for a whishes card which is meant to be discover with its illustrations.
So, i'm looking for any though, any light, in a way to prevent email clients from blocking images.
Thanks.
Image blocking is done on the receiver's end, by the mail client. There's nothing you can do about it.
It is because of this that you often see the
Can't see this email? View it here
(Or something similar) at the top of many emails. This is your best alternative.
Embed the image in the email, I strongly recommend something like phpMailer to do this.
From their documentation:
Inline Attachments
There is an additional way to add an attachment. If you want to make a
HTML e-mail with images incorporated into the desk, it's necessary to
attach the image and then link the tag to it.
For example, if you add an image as inline attachment with the CID
my-photo, you would access it within the HTML e-mail with <img
src="cid:my-photo" alt="my-photo" />.
In detail, here is the function to add an inline attachment:
$mail->AddEmbeddedImage(filename, cid, name); By using this function
with this example's value above, results in this code:
$mail->AddEmbeddedImage('my-photo.jpg', 'my-photo', 'my-photo.jpg ');
I am using the joomla mail function. I have attached a background-image for the message body.
The image is displayed in all tools like: Gmail, Yahoo, Rediff etc.
But it does not show in Outlook 2007.
Seaching the internet, I did not get any information to let me know, wether the img tag is supported in Outlook
Background images are not supported in Outlook for any elements other than the body tag of an HTML email. The body of the email is not the same thing as it refers to the contents of the email and not the HTML body tag.
You might also look at this hack to enable background images in outlook - http://emailmarketingvoodoo.com/blog/post/outlook-2007-can-now-render-background-images/
I am trying to send email as html with embedded images (not attachment) and as background.
I was trying to use Xpert Mailer but their documantion has small amount of information so I didnt succeed.
I was also trying to use Swiftmailer, with Swiftmailer I succeed to send email with embedded images but not as background.
Anyone has any clue how to send embbed images as background / has good PHP Email Sender?
Thanks!
Don't know about the apps you're using but this can be done by embedding the images in base64 format, looks like this:
<img src="data:image/gif;base64,R0lGODlhUAABLABLAMOREBASE64HERE">
Quick google search shows the following converter site: click
I found the answer. the problem was not my html or how I embedded the image. tha problem was that gmail doesnt support css property background / background-image and therefore it didnt work for me.
I had to use