Expected response code 250 but got code "", with message ""

87,404

Solution 1

looks like the smtp was blocked for hostinger free users.

http://www.hostinger.ph/forum/news-and-announcements/229-email-service-updates-1.html

Solution 2

I ran through this error so many times for some reasons.

When see this error,

Expected response code 250 but got code “”, with message “”

Please triple check your email password.

Note : Test your credentals first on a phone app or log-in into the mail site. If pass, you may update in your .env file

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mail.yahoo.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=****

If you know for sure that your password is correct.

Check to make sure your Gmail or Yahoo Mail allow app log-in.

Example

Yahoo

enter image description here

Solution 3

we solved this problem by clearing the Laravel's configuration cache

php artisan config:clear

Solution 4

This one worked for me, 'if you are using GMAIL'

  1. Go to 'My Accounts'
  2. Go to 'Sign-in & security'
  3. Scroll down to 'Allow less secure apps'
  4. Switch #3 to ON

After doing this and if you just recently set up your email configurations on laravel and still doesn't work, try running:

php artisan config:cache

Solution 5

FWIW - I get this error when sending a email with an empty string in the to field.

Share:
87,404

Related videos on Youtube

Primecore
Author by

Primecore

Updated on April 28, 2021

Comments

  • Primecore
    Primecore about 3 years

    I can send my emails in localhost flawlessly. but ever since I uploaded my program into a hosting site I get this error

    Expected response code 250 but got code "", with message ""

    I also updated the .env file.

    MAIL_DRIVER=smtp
    
    MAIL_HOST=smtp-mail.outlook.com
    
    MAIL_PORT=587
    
    [email protected]
    
    MAIL_PASSWORD=123456789
    

    works in localhost but not in the hosting site.

    i am using laravel 5

    • Kalle
      Kalle almost 9 years
      What is this program you have uploaded? What steps have you taken? Where does the error occur? If we have more information it will be easier to help you.
    • Blaatpraat
      Blaatpraat almost 9 years
      What hosting company are you using? More likely this is because your hosting company blocks outgoing traffic on 587.
    • Primecore
      Primecore almost 9 years
      @silverskin its a personal website. this page acts as contact us page. i didn't touch the mail.php anymore because it is working well in my localhost. so i assumed that it will do its job ones i've uploaded it.
    • Primecore
      Primecore almost 9 years
      @Blaatpraat hostinger. i'm just using free domain and hosting. i am just testing it if it will work IRL. i am using my personal e-mail to receive the message
  • hhsadiq
    hhsadiq almost 9 years
    @Primercore its always good practice to mark the answer which worked for you as an accepted answer. This way other users will have more confidence using this solution. I have noted you lately not marking some of your working answer as accepted. And you can also accept your own answer. Thanks for contributions to community.
  • JohnL
    JohnL over 6 years
    Fixed it for us.
  • Renoir Reis
    Renoir Reis over 6 years
    nice to hear it. Whenever i got stuck with laravel config problems i imediatly run composer dump autoload and php artisan config:cache, their are the best chances you have to start a problem solving on laravel.
  • JohnL
    JohnL over 6 years
    As it turned out, it was not a permanent fix. Ultimately I created a new Sendgrid account for that client which fixed issue - how I have no clue, but it did.
  • Renoir Reis
    Renoir Reis over 6 years
    have you checked your Sendgrid's send limits? Based on what your are describing the problem seems to be related to Sendgrid not with Laravel or PHP.
  • Nuwan Withanage
    Nuwan Withanage about 5 years
    Thankz bro you saved my time