【发布时间】:2017-03-19 11:29:54
【问题描述】:
我想通过 PHP 发送带有内联/嵌入图像(又名 cid)的邮件。邮件已在 Gmail 中成功发送和正确接收。但是,在 Thunderbird(Windows 的最新版本)中,内嵌/嵌入的图像不显示。
我按照this 线程中提供的信息进行操作,但仍然无法正常工作。因此,内嵌/嵌入的图像会显示在 Gmail 中,但不会显示在 Thunderbird 中。有人知道这里的问题吗?
To: example@example.com
Subject: Test
From: noreply@test.com <noreply>
MIME-Version: 1.0
Content-Type: multipart/related; boundary="52cd9ebf4fb8c9b0547e93b82b3f3f6b"
--52cd9ebf4fb8c9b0547e93b82b3f3f6b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test mail</title>
</head>
<body>
<img src="cid:myImage" alt="This is a embedded image" />
</body>
</html>
--52cd9ebf4fb8c9b0547e93b82b3f3f6b
Content-Type: image/jpg; name="myImage.jpg"
Content-Transfer-Encoding: base64
Content-ID: <myImage>
Content-Disposition: inline; filename="myImage.jpg"
[base64 encoded string goes here.]
--52cd9ebf4fb8c9b0547e93b82b3f3f6b--
【问题讨论】:
-
这听起来更像是一个本地问题。检查您的设置以查看图像是否没有被阻止(不)显示为默认值。
-
我很确定 Thunderbird 的设置是找到的。只是默认安装设置。
标签: php image email inline thunderbird