Adding images to an HTML email
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Adding images to an HTML email
I'm sending HTML emails but i want to add an image as background for the email. Do i store the image on a web-server and reference it using CSS?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: Adding images to an HTML email
It's possible not to, but yes you put it on the server.
But a heads up: background images are notoriously unsupported/not shown in email clients.
But a heads up: background images are notoriously unsupported/not shown in email clients.
- mecha_godzilla
- Forum Contributor
- Posts: 375
- Joined: Wed Apr 14, 2010 4:45 pm
- Location: UK
Re: Adding images to an HTML email
I'd second that - the HTML parsing engines in some email/web clients are truly awful, which is pretty dire considering that the target platform is still 4.01 Transitional. The email client on my reasonably recent smartphone can't even draw top and bottom borders for a 3 row/1 cell table to the same length in the same table. So good luck getting decent background image support 
As previously discussed, standard practice these days seems to be to host your images on a server. There are probably some benefits to this approach in respect of bandwidth issues, because you're moving the burden off of the mail server and on to your web server (where it arguably should be anyway). It might also be the case that some spam filters are more likely to block what it thinks is an unsolicited message if it has an attachment, because this technique was heavily used by spammers at one point - as long as the message gets through, the recipient sees the image, whereas if their servers had hosted the image then those servers might already have been taken offline or blacklisted by that point.
M_G
As previously discussed, standard practice these days seems to be to host your images on a server. There are probably some benefits to this approach in respect of bandwidth issues, because you're moving the burden off of the mail server and on to your web server (where it arguably should be anyway). It might also be the case that some spam filters are more likely to block what it thinks is an unsolicited message if it has an attachment, because this technique was heavily used by spammers at one point - as long as the message gets through, the recipient sees the image, whereas if their servers had hosted the image then those servers might already have been taken offline or blacklisted by that point.
M_G
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Adding images to an HTML email
mecha_godzilla wrote:So good luck getting decent background image support
^ very true, using background-image in the css doesn't work so i have to go for <img > tags instead. thanks for the inputs on the matterrequinix wrote:background images are notoriously unsupported/not shown in email clients.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Adding images to an HTML email
You can do this, but unfortunately background images are not supported by Microsoft Outlook -- which is a very common email client. Other web based email clients also do not support background images well. There is a workaround for Outlook (search the web for it).social_experiment wrote:I'm sending HTML emails but i want to add an image as background for the email. Do i store the image on a web-server and reference it using CSS?
(#10850)