Primecore
Primecore

Reputation: 521

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

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

Upvotes: 33

Views: 112010

Answers (8)

Mikhail Skorokhod
Mikhail Skorokhod

Reputation: 1

Swift_TransportException: Expected response code 250 but got an empty response intermittently in queue worker using Amazon SES

php artisan queue:work --sleep=3 --tries=3 --delay=30

or in my case (Phalcon):

php app/cli.php queue main --sleep=3 --tries=3 --delay=30

Upvotes: -1

bob tian
bob tian

Reputation: 11

in "mautic" (CRM), if you mail to a large amount of contacts, like more than 10k this occurs. The real reason is mostly a wrong configuration in php settings. For example:

max_input_time = 60

Will only let your server run the script for 60 seconds, try a higher value.

PHP configuration depends on your server and its installed software, mostly configured by htaccess or php.ini file.

Upvotes: 0

Renoir Reis
Renoir Reis

Reputation: 358

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

php artisan config:clear

Upvotes: 11

code-8
code-8

Reputation: 58652

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

Upvotes: 15

phirschybar
phirschybar

Reputation: 8579

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

Upvotes: 1

mpalencia
mpalencia

Reputation: 6007

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

Upvotes: 5

Rejaul
Rejaul

Reputation: 980

I've a working laravel swiftmailer using google server. Here my steps:

  1. I visited the link https://www.google.com/settings/security/lesssecureapps and turned on less secure apps.
  2. I edited .env file as like below:

    MAIL_DRIVER=smtp

    MAIL_HOST=smtp.gmail.com

    MAIL_PORT=587

    MAIL_USERNAME=username //i.e. [email protected]

    MAIL_PASSWORD=password //Gmail accounts password

    MAIL_ENCRYPTION=ssl

Edit username and password with your own.

  1. In my controller, I wrote the following code:

    $rawData = request::all();

    Mail::queue('program.meeting.emailInvite', $rawData, function($message) use ($rawData)

    {

    $message->from('[email protected]', 'Echosofts')->to(array_map('trim', explode(',', $rawData['all_email_id'])))->subject($rawData['mail_title']);

    });

Then email was working fine except the sender email ID was my google account ([email protected]) instead of [email protected].

  1. To overcome the sender email changing problem, I visited my google account and did the following:

"Setting icon"-> Settings -> Accounts and Import->Send mail as->Add another email address your own.

The following settings depends on your configuration.

    Email address: [email protected]
    SMTP server: mail.echosofts.com
    Username: [email protected]
    password:**********
    Port:25

Upvotes: 1

Primecore
Primecore

Reputation: 521

looks like the smtp was blocked for hostinger free users.

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

Upvotes: 7

Related Questions