Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

divostar's avatar

Swift_TransportException: Expected response code 250 but got code "", with message "" in AbstractSmtpTransport.php:383

I have a laravel application that has been sending emails for Years now. Recently, emails have been failing to send. When I check the failed_jobs table and Laravel log, below is the error message:

Swift_TransportException: Expected response code 250 but got code "", with message "" in /apps/www/ccc.xxxx.com/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383

Below are things I have attempted:

composer dump-autoload
php artisan config:cache
php artisan config:clear
php artisan queue:restart
restarted supervisor
Ensure username and password is correct in .env file
I have connected to the mail box successfully and able to send email to anyone

Below is the .env config

MAIL_DRIVER=smtp MAIL_HOST=smtp.office365.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=Va2016 MAIL_ENCRYPTION=TLS

The server runs on PHP 7.1.33. I suspect they might have been an upgrade to the PHP version which can cause this issue. But I am not really sure because others who use the server as well say they have not done any upgrade.

What can be the issue and how to fix this ?

0 likes
6 replies
splatEric's avatar

I hope that isn’t your actual password!!

Have office365 tightened up rules on authorisation that might be causing problems?

divostar's avatar

@splatEric I am not sure. Other laravel apps on other servers are sending emails with office365. It is not my actual password 🙂

splatEric's avatar

@divostar the only reason i asked is I saw comments regarding gmail where they started only accepting application passwords for smtp, rather than direct user auth. Might be worth a look

divostar's avatar

@splatEric the password is the password for office365. The system was sending mails without any issues before and then suddenly there is this issue. I am having a hard time figuring what has gone wrong. Port 587 is okay and no firewall blocking

divostar's avatar

@tisuchi Yes. I am the one who asked there. Unfortunately the tips there did not solve the issue.

Please or to participate in this conversation.