1

We started getting error Expected response code "250" but got empty code. when sending emails via Symfony Mailer on Laravel 10 and Mailchimp.

There are lots of similar questions and all of them were related to invalid credentials/not refreshed configs/etc. E.g. something was wrong with the setup.

In our case it is different.

Emails are sent by Laravel queue workers with retries. And when this error happens the email might be resent successfully on retry by the same worker on the same server.

So it is not a config issue.

This is how successful retry looks in logs: enter image description here

But what else could cause the same error?

P.S. Error began after upgrade from Laravel 8.XX to Laravel 10.

Gino Pane
  • 4,740
  • 5
  • 31
  • 46
  • Take a look at the Laravel upgrade guides: https://laravel.com/docs/9.x/upgrade and https://laravel.com/docs/10.x/upgrade and see if there's anything in there about Mailing. Actually, found something (possibly relevant): https://laravel.com/docs/9.x/upgrade#symfony-mailer; when upgrading from `8.x` to `9.x`, looks like a lot around the Mail logic has changed. See if that documentation can shed any light on your situation. – Tim Lewis Jul 13 '23 at 18:59
  • 1
    Yes, there was an issue with `setBody` which was used in our emails, switched to `html` method to fix that, and that was mentioned in the quide. Other than that it was fine – Gino Pane Jul 13 '23 at 19:03
  • 1
    Excellent; typically people don't follow the upgrade guide and often miss things like that glad to hear you went through the process and caught that already. – Tim Lewis Jul 13 '23 at 19:05
  • Hm, maybe this is the reason? "It is no longer possible to force a transport reconnection (for example when the mailer is running via a daemon process). Instead, Symfony Mailer will attempt to reconnect to the transport automatically and throw an exception if the reconnection fails." – Gino Pane Jul 13 '23 at 19:08

0 Answers0