HTML 电子邮件正文是否可以引用作为附件发送的文件(在同一封电子邮件中)?

问题描述:

HTML 电子邮件可以使用图像附件作为标签的来源吗?

Can an HTML email use an image attachment as the source for tag?

假设我要发送一封包含每个电子邮件特定图像的电子邮件 - 它们作为电子邮件的附件发送 - 电子邮件中的 HTML 正文可以使用这些图像吗?我的猜测是没有,但是是否有任何hacks 或解决方法可以使它起作用?

Let's say I am sending an email with per-email specific images - and they are sent as an attachment to the email - can the HTML body within the email use the those images? My guess would be no, but are there any hacks or workarounds that would make it work?

谢谢,

无需修改.使用 cid: URI 方案

No hacks needed. Use the cid: URI scheme

 --boundary-example 1
 Content-Type: Text/HTML; charset=US-ASCII

 to the other body part, for example through a statement such as:
 <IMG SRC="cid:foo4*foo1@bar.net" ALT="IETF logo">

 --boundary-example-1

 Content-ID: <foo4*foo1@bar.net>
 Content-Type: IMAGE/GIF
 Content-Transfer-Encoding: BASE64

 R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
 NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaGliaXRlZC4A
 etc...

 --boundary-example-1--