以PHPMailer attachments are showing up as base64-encoded text为基础,我使用PHPMailer通过Mandrill发送电子邮件。
这是我的GMail收件箱中的电子邮件内容:
这就是我想要的样子:
这是PHPMailer创建的电子邮件:
标题:
Date: Mon, 3 Sep 2018 17:23:30 -0500
From: neubert@neubert.com
Message-ID: <l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE@aa1b216e11db>
X-Mailer: PHPMailer 6.0.5 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE"
Content-Transfer-Encoding: 8bit
身体:
This is a multi-part message in MIME format.
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE
Content-Type: text/plain; charset=us-ascii
See attached!
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE
Content-Type: application/csv; name="test.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=test.txt
aGVsbG8sIHdvcmxkIQ==
这就是我在gmail中得到的东西:
标题:
From: Example <hello@example.com>
Sender: Example <hello@mail135-21.atl141.mandrillapp.com>
Subject: Attachment Test 9184364
Return-Path: <bounce-md_30776766.5b8db464.v1-b19ad375f24f410ab92db42268b72992@mandrillapp.com>
Received: from [34.225.176.22] by mandrillapp.com id b19ad375f24f410ab92db42268b72992; Mon, 03 Sep 2018 22:23:32 +0000
Message-Id: <6db92e16ffe7190ce4891eef6549cec7@swift.generated>
To: <neubert@neubert.com>
X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com
X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30776766.b19ad375f24f410ab92db42268b72992
X-Mandrill-User: md_30776766
Date: Mon, 03 Sep 2018 22:23:32 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="_av-oFI9mLO0ZP3IifF5xBDhHQ"
身体:
--_av-oFI9mLO0ZP3IifF5xBDhHQ
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
This is a multi-part message in MIME format.
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE Content-Type: text/plain;
charset=us-ascii See attached!
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE Content-Type:
application/csv; name="test.txt" Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=test.txt aGVsbG8sIHdvcmxkIQ==
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE--
--_av-oFI9mLO0ZP3IifF5xBDhHQ
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
This is a multi-part message in MIME format.
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE
Content-Type: text/plain; charset=us-ascii
See attached!
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE
Content-Type: application/csv; name="test.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=test.txt
aGVsbG8sIHdvcmxkIQ==
--b1_l3dhUHTYkrQSd0hXkGUZDYNoAYKEkAIt21aBAknnpJE--<img src="https://mandrillapp.com/track/open.php?u=30776766&id=b19ad375f24f410ab92db42268b72992" height="1" width="1">
--_av-oFI9mLO0ZP3IifF5xBDhHQ--
因此,看来Mandrill正在取代Multipart边界,并且在此过程中正在破坏我的外发电子邮件。
关于如何防止Mandrill破坏我的外发电子邮件的任何想法?
谢谢!