Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Right way to send HTML-Mails containing pictures: Use Server or Embedded images?

I want to ....

create a html-email containing several images (company header, etc).
The images shall be displayed as email content, not as an attachement.

So how is the best way to do this?


I'm aware of two possibilities:

  • embedded images send as attachment (<IMG src="cid:321353119@02062010-119E">)
  • images are placed on the server (<img src="http://myserver.com/mypicture.gif">)




like image 315
road242 Avatar asked Jun 09 '10 06:06

road242


1 Answers

Many mail clients will block access to external images (your second method) by default. However, most will display the images in your first method without blocking.

The reason for this is that you can use the fact that the mail client accessed the server to download the external images as a way of "tracking" whether the email was opened and therefore viewed by the user - it's a privacy concern. There is no such issue with attached images.

The downside of your first method is that it increases the size of the messages you send. Nobody likes to receive a 200KB message with 199KB of logos and junk and 1KB of actual content...

like image 145
Dean Harding Avatar answered Sep 26 '22 05:09

Dean Harding