My Magento 2.3.4 doesn’t send emails. I’ve checked these options:
- Stores -> Configuration -> Advanced -> System Disable Email Communications is set to No.
- Navigate to Stores -> Configuration -> Sales -> Sales Emails under the General Settings tab, Asynchronous sending disabled.
However, despite these checks, the issue persists. In the log, I found the following error:
main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Unable to send mail: Unknown error at /home/customer/www/mysite/public_html/vendor/magento/module-email/Model/Transport.php:103, Zend\\Mail\\Transport\\Exception\\RuntimeException(code: 0): Unable to send mail: Unknown error at /home/customer/www/mysite/public_html/vendor/zendframework/zend-mail/src/Transport/Sendmail.php:305)"} []
My PHP version is 7.3.33 with SiteGround. The emails were working correctly until about 1-2 years ago.
UPDATE
LOGS:
main.WARNING: Broken reference: The element with the "customer" ID wasn't found. Verify the ID and try again. [] []
main.CRITICAL: Deprecated Functionality: Method ReflectionParameter::getClass() is deprecated in /home/customer/www/mysite/public_html/vendor/magento/framework/Code/Reader/ClassReader.php on line 36 {"report_id":"bbc7faab10cdb433fd895c751eca68f9aae15f45606dc465c9f86a4d7e5db962","exception":"[object] (Exception(code: 0): Deprecated Functionality: Method ReflectionParameter::getClass() is deprecated in /home/customer/www/mysite/public_html/vendor/magento/framework/Code/Reader/ClassReader.php on line 36 at /home/customer/www/mysite/public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []
If i use sendmail command through ssh the emails are sent.