Search code examples
phpsymfonyshopwaresymfony-mailer

Shopware: Unable to connect with STARTTLS without encryption


In my .env file I have:

MAILER_URL="smtp://localhost:25?encryption=&auth_mode="

But if I send a mail the log shows:

Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Unable to connect with STARTTLS. Error Code:0 Template data ...

Looks like it tries to use TLS but I don't want to. It worked before. Maybe it got broken by an update.

Looking at the documentation I also tried encryption=null with same result.

Debugging in vendor/shopware/core/Content/Mail/Service/MailerTransportFactory.php:36 I made sure my MAILER_URL was used.

I am using shopware 6.4.1.1 with symfony/mailer v5.2.10

How can I get mails working again?


Solution

  • By default, the SMTP transport in the Symfony Mailer performs TLS peer verification. You can disable this verification by setting the parameter verify_peer to 0, for example:

    MAILER_URL="smtp://localhost:25?encryption=&auth_mode=&verify_peer=0"