aheckmann / node-ses

An Amazon SES api for nodejs with proper error handling.
http://aheckmann.github.com/node-ses
MIT License
201 stars 37 forks source link

Does this conform with RFC 2822? #51

Closed rsmolkin closed 6 years ago

rsmolkin commented 6 years ago

Hi,

We've stumbled on your code while looking to a solution where some emails we were sending using Amazon SES SendRawEmail were bouncing with error codes 500, 501 and a few others due to lines being too long. It appears that subjects that are longer than 76 characters need to be split into multiple line with everything after the 1st line starting with a space and all lines ending with a CRLF.

Similar issue with HTML emails where it seems all HTML is treated as one line and also needs to be split up with CRLF.

Does your package handle the issues with long lines in HTML emails and subjects?

markstos commented 6 years ago

Does your package handle the issues with long lines in HTML emails and subjects?

No. Our documentation is clear on this point:

" The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent."

Using a library that creates valid MIME messages is recommended if you need that. Once you have a valid MIME body, you can pass that to this module.

The idea with "raw", is that you are providing a valid message and this module just sends it as-is.