I’ve got a tricky issue sending emails with multiple recipients. It’s on a company intranet and some of the recipients are on a 2010 Exchange server and some are on a 2007 Exchange server. Basically, the headers appear in the body of the email, but the tricky part is sometimes it only seems to happen to those on the 2007 Exchange server…
Here’s an example output from the script.
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
This one sent just fine, however, if I increase the recipients the email will fail, and it displays everything below From: thesender@someemailer.com in the content of the email.
I’ve tried sending just the text/plain or just the text/html but both appear to fail regardless, the only consistent failure appears to be recipient length. I’m a little at loss as to what to try next.
I’m using this module for sending emails: https://github.com/andris9/Nodemailer
Alright, appears to be caused directly by the length of the “To:” field. When I send multiple (~200) email recipients in a straight string, it would cause the problem. I’m not sure if this is a Microsoft only thing, but when I break the “To:” string into 3 emails followed by a newline it works fine.