发送包含图片的HTML邮件的正确方法:使用服务器图像还是嵌入式图像?
我要....
创建一个包含多个图像(公司标头等)的html电子邮件.
图片应显示为电子邮件内容,而不是附件.
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:
- 嵌入的图像作为附件发送(
< IMGsrc ="cid:321353119 @ 02062010-119E">
) - 图像放置在服务器上(
< img src ="http://myserver.com/mypicture.gif">
)
默认情况下,许多邮件客户端将阻止对外部图像的访问(第二种方法).但是,大多数将以您的第一种方法显示图像而不会阻塞.
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.
第一种方法的缺点是它增加了发送消息的大小.没有人喜欢收到200KB的消息,其中包含199KB的徽标和垃圾以及1KB的实际内容...
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...