最佳答案
我试图发送一个多部分/相关的 HTML 电子邮件与嵌入的 gif 图像。此电子邮件是使用 Oracle PL/SQL 生成的。我的尝试失败了,图像显示为红色 X (在 Outlook2007和雅虎邮件中)
我已经发送了一段时间的 html 电子邮件,但我现在的要求是在电子邮件中使用几个 gif 图像。我可以存储在我们的网络服务器之一,只是链接到他们,但许多用户的电子邮件客户端将不会显示他们自动,将需要更改设置或手动下载他们为每个电子邮件。
因此,我的想法是嵌入图像。我的问题是:
片段:
MIME-Version: 1.0
To: me@gmail.com
BCC: me@yahoo.com
From: email@yahoo.com
Subject: Test
Reply-To: email@yahoo.com
Content-Type: multipart/related; boundary="a1b2c3d4e3f2g1"
--a1b2c3d4e3f2g1
content-type: text/html;
<html>
<head><title>My title</title></head>
<body>
<div style="font-size:11pt;font-family:Calibri;">
<p><IMG SRC="cid:my_logo" alt="Logo"></p>
... more html here ...
</div></body></html>
--a1b2c3d4e3f2g1
Content-Type: image/gif;
Content-ID:<my_logo>
Content-Transfer-Encoding: base64
Content-Disposition: inline
[base64 image data here]
--a1b2c3d4e3f2g1--
非常感谢。
顺便说一句: 是的,我已经验证了 base64数据是正确的,因为我可以将图像嵌入 html 本身(使用相同的算法来创建头数据) ,并在 Firefox/IE 中查看图像。
我还应该指出,这不是垃圾邮件,电子邮件发送给特定的客户谁是期待它每天。内容是数据驱动的,而不是广告。