Closed aalqadri closed 2 years ago
Can you provide more information...? It sounds like a configuration or setup problem on your side. html2text is intended to work on HTML ONLY, not on e.g. MIME
The library converts the HTML body of the email to text as expected. However, when attempting to send the email with an attachment, SES requires the email to be sent as RAW, and that causes delivery failure due to the error: smtp; 501 Syntax error - line too long
Can you provide any more information, such as your setup, the emails you are trying to send, how you're connecting to SES?
We're using this library: https://github.com/daniel-zahariev/php-aws-ses As long the email doesn't have an attachment, the email is sent with no issues, when an attachment is added, SES accepts the email and returns a message ID. However, we receive a delivery failure few seconds later with the above error message.
Thank you - how are you using html2text with that library? From what I can see that library doesn't depend on html2text directly.
When sending an email, you have the option to send the html email as a text for older email clients that don't view html. Since our html emails are dynamically generated, we are converting the html to text and pass the html string and the text string to the library above. Currently I'm using another html2txt library and it is working with no issues.
Works great with AWS SES as long as you don't have attachments and must send email as RAW. When email is sent as RAW, text causes delivery failure.