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

我怕爱的太早我们不能终老 提交于 2021-01-27 05:23:51

问题


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">)





回答1:


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...




回答2:


Images on your server -

  • Saves storage on mail servers
  • Decreased bandwidth for you to send
  • Keeps the download smaller for the end-user
  • Gives you control over the images post-send


来源:https://stackoverflow.com/questions/3003499/right-way-to-send-html-mails-containing-pictures-use-server-or-embedded-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!