Page 1 of 1

Adding images to an HTML email

Posted: Sun May 26, 2013 6:00 am
by social_experiment
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?

Re: Adding images to an HTML email

Posted: Sun May 26, 2013 8:59 am
by requinix
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.

Re: Adding images to an HTML email

Posted: Sun May 26, 2013 6:06 pm
by mecha_godzilla
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 :mrgreen:

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

Re: Adding images to an HTML email

Posted: Mon May 27, 2013 1:23 am
by social_experiment
mecha_godzilla wrote:So good luck getting decent background image support
requinix wrote:background images are notoriously unsupported/not shown in email clients.
^ 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 matter

Re: Adding images to an HTML email

Posted: Mon May 27, 2013 10:02 am
by Christopher
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?
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).