multipart/mixed 不适用于 thunderbird 和 hotmail,但适用于 Gmail
multipart/mixed not working in thunderbird and hotmail but Gmail
以下是雷鸟收到的邮件源代码。
我找不到任何语法错误,它在 gmail 中运行良好。
但对于 hotmail 和 thunderbird,附件已损坏且内容为空白....
我已经尝试了很长时间来解决这个问题。有帮助吗?
Subject: MySubject
From: testing@test.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55"
Content-Transfer-Encoding: 7bit
Cc: cc@cc.com
Message-Id: <20161123030114.97B04DCD682@server.com>
Date: Wed, 23 Nov 2016 11:01:14 +0800 (MYT)
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
<p>Test</p>
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: application/pdf; name="Attachment.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Attachment.pdf"
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
--02f05ee7d40220f0ebab50ef7440ca55--
感谢@mkl 的回答。
经过一些修改,我的代码成功了!!
"There must be a empty line between header and content."
是重点
Subject: MySubject
From: testing@test.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55"
Content-Transfer-Encoding: 7bit
Cc: cc@cc.com
Message-Id: <20161123030114.97B04DCD682@server.com>
Date: Wed, 23 Nov 2016 11:01:14 +0800 (MYT)
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
<p>Test</p>
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: application/pdf; name="Attachment.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Attachment.pdf"
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
--02f05ee7d40220f0ebab50ef7440ca55--
以下是雷鸟收到的邮件源代码。 我找不到任何语法错误,它在 gmail 中运行良好。 但对于 hotmail 和 thunderbird,附件已损坏且内容为空白.... 我已经尝试了很长时间来解决这个问题。有帮助吗?
Subject: MySubject
From: testing@test.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55"
Content-Transfer-Encoding: 7bit
Cc: cc@cc.com
Message-Id: <20161123030114.97B04DCD682@server.com>
Date: Wed, 23 Nov 2016 11:01:14 +0800 (MYT)
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
<p>Test</p>
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: application/pdf; name="Attachment.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Attachment.pdf"
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
--02f05ee7d40220f0ebab50ef7440ca55--
感谢@mkl 的回答。 经过一些修改,我的代码成功了!!
"There must be a empty line between header and content."
是重点
Subject: MySubject
From: testing@test.com
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55"
Content-Transfer-Encoding: 7bit
Cc: cc@cc.com
Message-Id: <20161123030114.97B04DCD682@server.com>
Date: Wed, 23 Nov 2016 11:01:14 +0800 (MYT)
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
<p>Test</p>
--02f05ee7d40220f0ebab50ef7440ca55
Content-Type: application/pdf; name="Attachment.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Attachment.pdf"
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
PDF ATTACHMENT CODES HERE
--02f05ee7d40220f0ebab50ef7440ca55--