首页 文章

使用nodemailer向node Exchange发送带有node.js的电子邮件时出现问题( Headers 显示在电子邮件正文中)

提问于
浏览
0

发送包含多个收件人的电子邮件时,我遇到了棘手的问题 . 它位于公司内部网上,部分收件人位于2010 Exchange服务器上,部分收件人位于2007 Exchange服务器上 . 基本上, Headers 出现在电子邮件的正文中,但棘手的部分有时似乎只发生在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

1 回答

  • 1

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

相关问题