Leap Hawk
Leap Hawk

Reputation: 661

Laravel mail setupSwift_TransportException: Expected response code 250 but got code "", with message ""

There are similar questions asked here before. But that are not helping me around solving the problem. This is my current mail configuration in .env file of my laravel file:

   MAIL_DRIVER=smtp
   MAIL_HOST=****.prod.sin2.secureserver.net
   MAIL_PORT=465
   MAIL_USERNAME=****@somedomain.com
   MAIL_PASSWORD=*****
   MAIL_ENCRYPTION=ssl

I've re verified the mail server and credentials. They are accurate and it establishes a connection while tried with php artisan tinkerfrom command prompt with similar response while using the Mail facade of Laravel.

Please help me with this.

Upvotes: 0

Views: 611

Answers (1)

ray sn0w
ray sn0w

Reputation: 1209

Just in case some had the same problem as me, with SMTP and Gmail configuration, my problem was an incorrect server name configured on nginx. You can test this by echoing $_SERVER['SERVER_NAME'] if you have something like I did: ~^(?.*)$ its going to throw that error.

You need to check you nginx config and test the output of the server name.

Thanks to @jagsler for pointing this in the comments.

Upvotes: 2

Related Questions