2017-07-02 76 views
0

我想用new mail()發送電子郵件,它幾乎可以工作。已發電子郵件有內容,但無法看到

發送的電子郵件在原始郵件中具有所需的內容,但Apple Mail(應用程序)無法讀取它。

這是郵件(Apple App)問題還是郵件(ColdFusion object)問題?

最後但並非最不重要的,ColdFusion的運行在Windows上10

ColdFusion代碼

var mail = new mail(); 

mail.setFrom(application.EMAILFROM); 
mail.setTo(arguments.email); 
mail.setSubject(application.GSSITE_FULL_NAME & " Password Reset"); 
mail.addPart(type="plain", charset="utf-8", body="This is a test message."); 
mail.send();  

電子郵件程序會導致

enter image description here 原始電子郵件

Return-Path: <[email protected]> 
Received: from 10.211.55.15 (cpe-76-169-198-102.socal.res.rr.com [76.169.198.102]) by mail.xxx.com with SMTP; 
    Sat, 1 Jul 2017 19:41:27 -0700 
Date: Sat, 1 Jul 2017 19:41:26 -0700 (PDT) 
From: [email protected] 
To: [email protected] 
Message-ID: <[email protected]> 
Subject: xxx Password Reset 
MIME-Version: 1.0 
Content-Type: multipart/alternative; 
    boundary="----=_Part_78_1984282986.1498963286427" 
X-Mailer: ColdFusion 2016 Application Server 
X-SmarterMail-TotalSpamWeight: 0 (Authenticated) 

------=_Part_78_1984282986.1498963286427 
Content-Type: text/plain; charset=utf-8 
Content-Transfer-Encoding: 7bit 

This is a test message. 
------=_Part_78_1984282986.1498963286427 
Content-Type: text/plain; charset=UTF-8 
Content-Transfer-Encoding: 7bit 


------=_Part_78_1984282986.1498963286427-- 

幫助

這是怎麼回事?

+0

其他電子郵件網站或客戶端會發生什麼情況? –

+0

將HTML部分添加到郵件中,它將在iOS設備上正確顯示。上次我查了一下,這些部分的順序也很重要,也就是plain必須是第一個,然後是HTML。 – Alex

+0

這正是需要的。你可以把你的評論作爲答案嗎? –

回答

4

這是一個影響所有iOS設備的已知問題。爲了避免它,一個HTML部件添加到您的郵件正文:

mail.addPart(type="plain", charset="utf-8", body="This is a test message."  ); 
mail.addPart(type="html", charset="utf-8", body="<p>This is a test message.</p>"); 

確保平坦的部分,因爲這是問題的一部分郵件部分之前添加。

爲什麼?誰知道?這可能是嚴格遵循RFC的SHALL/SHOULD/MAY和蘋果方面的不當實現的組合。