magento-2-smtp icon indicating copy to clipboard operation
magento-2-smtp copied to clipboard

Unable to send mail: Unknown error

Open shayan-hussaini-10p opened this issue 4 years ago • 18 comments

Preconditions (*)

  1. Magento version 2.4.0
  2. PHP version 7.4
  3. SMTP Extension version 1.4.1

Steps to reproduce (*)

Installed extension running Send Test Email function

Expected result (*)

Email should be sent

Actual result (*)

Getting error: Unable to send mail: Unknown error Logs:

==> var/log/exception.log <==
[2020-08-21 19:54:41] main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Unable to send mail: Unknown error at /var/www/html/app/code/Magento/Email/Model/Transport.php:103, Laminas\\Mail\\Transport\\Exception\\RuntimeException(code: 0): Unable to send mail: Unknown error at /var/www/html/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:306)"} []

==> var/log/debug.log <==
[2020-08-21 19:54:41] main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\\Framework\\Exception\\MailException(code: 0): Unable to send mail: Unknown error at /var/www/html/app/code/Magento/Email/Model/Transport.php:103, Laminas\\Mail\\Transport\\Exception\\RuntimeException(code: 0): Unable to send mail: Unknown error at /var/www/html/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:306)"} []

shayan-hussaini-10p avatar Aug 21 '20 20:08 shayan-hussaini-10p

Hi,

Would you please provide me some screenshots of the Smtp configuration page and error message when you try sending test email in the configuration page.

Thank you!

HuyPhuc98 avatar Aug 24 '20 02:08 HuyPhuc98

This is the configuration (I am using Amazon SES) and tried it with both options SSL with port 465 and TLS with port 587: smtp-settings-1

This is the error I am getting on admin panel: smtp-error-1

shayan-hussaini-10p avatar Aug 24 '20 09:08 shayan-hussaini-10p

Hi,

Would you please let me know which version of Magento and Smtp you are using. Also, can you provide me the Smtp configuration you are using and the email account you use in General-> Stores Email Address so I can reproduce your problem?

Thank you!

HuyPhuc98 avatar Aug 25 '20 08:08 HuyPhuc98

Hi,

Would you please let me know which version of Magento and Smtp you are using. Also, can you provide me the Smtp configuration you are using and the email account you use in General-> Stores Email Address so I can reproduce your problem?

Thank you!

Versions are mentioned in the initial comment. Magento 2.4 and extension version is 1.4.1 The SMTP configuration is loaded from your provided templates and the email address is from gmail which is verified on Amazon SES.

Note: Same settings has been configured with another smtp extension and its working perfectly

shayan-hussaini-10p avatar Aug 25 '20 10:08 shayan-hussaini-10p

Your problem may be due to module compatibility with Magento 2.4.0 version. I will check on the local page and will notify you of the results.

Thank you!

HuyPhuc98 avatar Aug 26 '20 10:08 HuyPhuc98

Any update on this issue. I have the same setup (i.e. Magento 2.4) and getting the same error. I'm trying to set it up with Sendgrid.

raoultpb avatar Mar 09 '21 19:03 raoultpb

Same issue for me - no update?

thomas7467 avatar Jun 06 '21 15:06 thomas7467

Same issue here.

  • Magento 2.4.2-p1
  • "mageplaza/module-smtp": 1.9.0 (composer)
  • using Mailgun SMTP settings to send email
  • port: 587 / protocol: tls / host: smtp.mailgun.org / authentication: login

The test e-mail goes well and is delivered. But when some other action tries to send email we got error.

[2021-07-17 03:29:35] main.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\Framework\Exception\MailException(code: 0): Unable to send mail: Unknown error at /var/www/mysite/src/vendor/magento/module-email/Model/Transport.php:103, Laminas\Mail\Transport\Exception\RuntimeException(code: 0): Unable to send mail: Unknown error at /var/www/mysite/src/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:304)"} []

r-martins avatar Jul 17 '21 04:07 r-martins

@thomas7467 Did you fix it?

r-martins avatar Jul 28 '21 07:07 r-martins

Hi, I'm using Magento 2.4.1 release, smtp extension version 4.3.2 I've configured the module with sendgrid , port 587, TLS, LOGIN and it works.

installed with composer : composer require mageplaza/module-smtp

thomas7467 avatar Jul 28 '21 11:07 thomas7467

Thanks, @thomas7467. This should be related to the newer version of Magento. I'll try to use AWS SES in my next test. Let's see.

r-martins avatar Jul 28 '21 21:07 r-martins

same issue here using magento 2.4.2 report.CRITICAL: Unable to send mail: Unknown error {"exception":"[object] (Magento\Framework\Exception\MailException(code: 0): Unable to send mail: Unknown error at /app/vendor/magento/module-email/Model/Transport.php:103, Laminas\Mail\Transport\Exception\RuntimeException(code: 0): Unable to send mail: Unknown error at /app/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:304)"} []

lucianopeluso10 avatar Sep 29 '21 15:09 lucianopeluso10

Same issue here using magento 2.4.3 clean installatino + sampleData

main.ERROR: Unable to send mail: Unknown error {"exception":"[object] (Laminas\Mail\Transport\Exception\RuntimeException(code: 0): Unable to send mail: Unknown error at /var/www/html/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:298)"} []

pablobae avatar Oct 02 '21 18:10 pablobae

magento 2.4.3., extension doesnt work

cryptoso avatar Dec 06 '21 18:12 cryptoso

magento 2.4.3 smtp 4.7.0 / The test emails get through ok, but customers and shop admins don't get emails

gitmoorka avatar Jan 25 '22 21:01 gitmoorka

You need to install magento from composer, not from github. Because version compare can not work.$this->helper->versionCompare('2.2.0'). OR edit code public function getVersion() { $this->version = $this->version ?: $this->cache->load(self::VERSION_CACHE_KEY); if (!$this->version) { if (!($this->version = $this->getSystemPackageVersion())) { if ($this->getComposerInformation()->isMagentoRoot()) { //$this->version = $this->getComposerInformation()->getRootPackage()->getPrettyVersion(); $this->version = '2.4.3'; } else { $this->version = 'UNKNOWN'; } } $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } return $this->version; }

luojie234 avatar Feb 10 '22 07:02 luojie234

You need to install magento from composer, not from github. Because version compare can not work.$this->helper->versionCompare('2.2.0'). OR edit code public function getVersion() { $this->version = $this->version ?: $this->cache->load(self::VERSION_CACHE_KEY); if (!$this->version) { if (!($this->version = $this->getSystemPackageVersion())) { if ($this->getComposerInformation()->isMagentoRoot()) { //$this->version = $this->getComposerInformation()->getRootPackage()->getPrettyVersion(); $this->version = '2.4.3'; } else { $this->version = 'UNKNOWN'; } } $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } return $this->version; }

Where found this path?

gscogna avatar Mar 21 '22 10:03 gscogna

Hi, I did install both Magento 2 and SMTP Extension from composer.

The test email was sent and received successfully. But none of the other emails (Contact Us, User Signup, etc.) were sent. I got the following error.

[2022-03-22 15:35:44] main.ERROR: Unable to send mail: Unknown error {"exception":"[object] (Laminas\Mail\Transport\Exception\RuntimeException(code: 0): Unable to send mail: Unknown error at /var/www/html/magento2/vendor/laminas/laminas-mail/src/Transport/Sendmail.php:298)"} []

Magento 2 version: 2.4.3-p1 SMTP Extension version: 4.7.0

Please help!

calvin63 avatar Mar 22 '22 15:03 calvin63