Email delivery issue – 501 Syntax error
-
Hello,
We have emails not delivered due to this error: 501 Syntax error – line too long
This email issue occurred when system sends email with PDF attachments using SMTP.com API only,
only few email servers rejects the emailsand we tried to investigated the issue with comparing other email libraries(PHPMailer), we found there is an issue in attachment string, Usually the PDF attachment converted into long string when send through emails
When using SMTP.com API the PDF is converted into 559882 characters in single line, (more than 76 characters allowed by RFC 2822 section 2.1.1.), You can check the .eml file
This issue 559882 characters in single line occur only when sending via SMTP.com, But this issue not occur when sending via default PHP email option in the plugin.
So we modified the following file in Version 2.3.1 to fix the issue in our server
/wp-content/plugins/wp-mail-smtp/src/Providers/SMTPcom/Mailer.php Removed line: 'content' => base64_encode( $file ), Added line: 'content' => chunk_split(base64_encode($file), 76, "\r\n"),Please review the above changes and implement them in next version of the plugin.
thanks
The topic ‘Email delivery issue – 501 Syntax error’ is closed to new replies.