All,
We have identified an issue when using the EmailSend() instruction with services like smtp.gmail.com and smtp.mail.yahoo.com.
The quick take away message is:
For released / previous OS's, do not include extraneous spaces in the ToAddr parameter of EmailSend(). For example instead of specifying "tom@mail.com, richard@mail.com, harry@mail.com", please specify "tom@mail.com,richard@mail.com,harry@mail.com".
Symptoms Reported:
When sending emails to more than two recipients, EmailSend() fails or some of the recipients fail to receive the message. When using Yahoo, the EmailSend() instruction was returning 0 (failed) and the server was responding with "501 Syntax error in arguments". When using GMail, the EmailSend() instruction was returning -1 (success) but the second recipient would not receive the message; upon further investigation we found a "Mail Delivery Failure" response from the server sitting in our GMail account inbox.
The Cause:
The EmailSend() instruction is not always stripping leading/trailing spaces from email addresses passed in as a CSV list. RFC5321 does say: "Since it has been a common source of errors, it is worth noting that spaces are not permitted on either side of the colon following FROM in the MAIL command or TO in the RCPT command."
Short Term Fix:
Just modify your program by removing all of the extraneous spaces in your TO, FROM, etc. parameters passed into EmailSend().
Long Term Fix:
A change in the OS to automatically remove any leading or trailing spaces in the addresses passed in.