1

when contact us page submit but email not received but messages display

Thanks for contacting us with your comments and questions. We'll respond to you very soon.

in debug.log I get this error.

main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Unable to send mail: Unknown error at /public_html/vendor/magento/module-email/Model/Transport.php:104, Zend\\Mail\\Transport\\Exception\\RuntimeException(code: 0): Unable to send mail: Unknown error at /public_html/vendor/zendframework/zend-mail/src/Transport/Sendmail.php:305)"} []

in exception.log I get this error.

main.CRITICAL: Invalid header value detected {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Invalid header value detected at /public_html/vendor/magento/module-email/Model/Transport.php:104, Zend\\Mail\\Header\\Exception\\RuntimeException(code: 0): Invalid header value detected at /public_html/vendor/zendframework/zend-mail/src/Header/HeaderValue.php:112)"} []
0

A potential fix is to add encoding in vendor/magento/framework/Mail/Template/TransportBuilder.php

--- vendor/magento/framework/Mail/Template/TransportBuilder.php.org 2019-10-07 17:16:16.946791204 +0200
+++ vendor/magento/framework/Mail/Template/TransportBuilder.php 2019-10-07 17:16:44.243320666 +0200
@@ -402,6 +402,7 @@
             (string)$template->getSubject(),
             ENT_QUOTES
         );
+        $this->messageData['encoding'] = $mimePart->getCharset();
         $this->message = $this->emailMessageInterfaceFactory->create($this->messageData);

         return $this;

https://github.com/magento/magento2/issues/24902

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.