2017-07-02 26 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和苹果方面的不当实现的组合。

相关问题