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)"} []
3
  • Have you set SMTP correct? Apr 3, 2020 at 9:23
  • @VijayKhirade im use magentos default configuration
    – rocky9310
    Apr 3, 2020 at 9:32
  • getting almost same error on 2.3.4 Apr 3, 2020 at 20:07

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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