【问题标题】:Problem sending emails with node.js using nodemailer to Microsoft Exchange (headers show up in email body)使用 nodemailer 向 Microsoft Exchange 发送带有 node.js 的电子邮件时出现问题(标题显示在电子邮件正文中)
【发布时间】:2011-02-25 14:53:06
【问题描述】:

我在发送包含多个收件人的电子邮件时遇到了一个棘手的问题。它位于公司 Intranet 上,一些收件人位于 2010 Exchange 服务器上,而一些收件人位于 2007 Exchange 服务器上。基本上,标题出现在电子邮件的正文中,但棘手的部分是有时它似乎只发生在 2007 Exchange 服务器上的那些...

这是脚本的示例输出。

Command 'DATA' sent, response:
354 Start mail input; end with <CRLF>.<CRLF>
X-Mailer: Nodemailer (0.1.5; +http://www.nodemailer.org)
From: thesender@someemailer.com
To: a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com, a_bunch_of_emails@someemailer.com
Subject: Test email, Test email, Test email, Test email, Test email, Test email, Test email, Test email, Test email
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=----NODEMAILER-1-1298645067811

--------------(Headers End and Body Begins)-----------------

 ------NODEMAILER-1-1298645067811
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Plain Text Body

------NODEMAILER-1-1298645067811
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Html Body

------NODEMAILER-1-1298645067811--
221 2.0.0 <SERVER IM CONNECTING TO> Service closing transmission channel

这封邮件发送得很好,但是,如果我增加收件人,电子邮件将失败,并在电子邮件内容中显示From: thesender@someemailer.com 以下的所有内容。

我尝试仅发送 text/plain 或仅发送 text/html,但无论如何都似乎失败了,唯一一致的失败似乎是收件人长度。我不知道接下来要尝试什么。

我正在使用此模块发送电子邮件:https://github.com/andris9/Nodemailer

【问题讨论】:

    标签: node.js exchange-server


    【解决方案1】:

    好的,似乎是由“To:”字段的长度直接引起的。当我以直字符串发送多个(~200)电子邮件收件人时,会导致问题。我不确定这是否是微软唯一的事情,但是当我将“To:”字符串分成 3 封电子邮件后跟一个换行符时,它可以正常工作。

    【讨论】:

      猜你喜欢
      • 2013-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-04
      • 2020-05-31
      • 2019-11-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多