2016-11-23 51 views
1

以下是我的thunderbird收到的電子郵件的源代碼。 我無法找到任何語法錯誤,並且它在gmail中運行良好。 但是,對於Hotmail和雷鳥的附件是壞的,內容是空白的.... 我已經嘗試了很長時間來解決這個問題。任何幫助?multipart/mixed在thunderbird和Hotmail中不工作但是Gmail

Subject: MySubject 
From: [email protected] 
MIME-Version: 1.0 
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55" 
Content-Transfer-Encoding: 7bit 
Cc: [email protected] 
Message-Id: <[email protected]> 
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-- 
+1

在報頭和內容之間的空行似乎缺少的部件。 – mkl

+1

並且整體CTE 7bit對於MIME部件CTE 8bit不能很好地工作。 – mkl

+0

@mkl噢,我的上帝,你是我的救星!我想你應該在下面寫下你的答案,讓我選擇它作爲其他方便的最佳答案。 非常感謝你! –

回答

0

感謝@mkl的回答。 經過一些修改後,我的代碼已經工作!

"There must be a empty line between header and content." 是點

Subject: MySubject 
From: [email protected] 
MIME-Version: 1.0 
Content-Type: multipart/mixed; boundary="02f05ee7d40220f0ebab50ef7440ca55" 
Content-Transfer-Encoding: 7bit 
Cc: [email protected] 
Message-Id: <[email protected]> 
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-- 
+0

如上所述,總體CTE 7bit與MIME部件CTE 8bit結合意味着長期需要解決問題。 – mkl

+0

您應該接受您自己的答案... – mkl

相關問題