我正在尝试使用new mail()
发送电子邮件,它几乎可以使用。
发送的电子邮件在原始邮件中包含所需内容,但Apple Mail(app)无法读取。
这是邮件(Apple App)问题还是邮件(ColdFusion对象)问题?
最后但并非最不重要的是,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();
电子邮件程序结果
Return-Path: <no-reply@xxx.com>
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: no-reply@xx.com
To: james@xxx.com
Message-ID: <65588416.79.1498963286429@mail.xxx.com>
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 :(得分:5)
这是影响所有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以及Apple方面的不当实施的组合。