Laravel Expected Response Code 250 But Got Code "530"

laravel Expected response code 250 but got code 530

you need to enable your 2 step verification from gmail account.

https://myaccount.google.com/security

then use the generated key from there to your ENV_PASSWORD instead your real password.

Expected response code 250 but got code 530, with message 530 5.7.1 Authentication required

your mail.php on config you declare host as smtp.mailgun.org and port is 587 while on env is different. you need to change your mail.php to

'host' => env('MAIL_HOST', 'mailtrap.io'),
'port' => env('MAIL_PORT', 2525),

if you desire to use mailtrap.Then run

php artisan config:cache

Laravel 5.5 Expected response code 250 but got code 530

I' may suggest you use this as well, it worked for me,

Please Note if you're using Gmail: create a gmail app password, but be sure to your 2 Step verification set up, from sign in and securiity, the following link: https://myaccount.google.com/apppasswords to setup app password,
use that and follow procedure 2 after this return to set up gmail with smtp.

please note: code down below are for mail.php file

(do not forget to use: php artisan config:cache)
after changes to .env file as well

return [

'driver' => env('MAIL_DRIVER', 'smtp'),

'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),

'port' => env('MAIL_PORT', 2525),

'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'lxxxx@xxxx.com'),
'name' => env('MAIL_FROM_NAME', 'myMail'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),

'username' => env('MAIL_USERNAME'),//this setting in .env only leave as is here

'password' => env('MAIL_PASSWORD'),//this setting in .env only leave as is here

'sendmail' => '/usr/sbin/sendmail -bs',

'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],

'markdown' => [
'theme' => 'default',

'paths' => [
resource_path('views/vendor/mail'),
],
],
];

//procedure 2 for gmail
return [

'driver' => env('MAIL_DRIVER', 'smtp'),

'host' => env('MAIL_HOST', 'smtp.gmail.com'),

'port' => env('MAIL_PORT', 587),

'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'lxxxx@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'myMail'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),

'username' => env('MAIL_USERNAME'),//this setting in .env only leave as is here

'password' => env('MAIL_PASSWORD'),//this setting in .env only (use app password you created for gmail and PLEASE leave as is here

'sendmail' => '/usr/sbin/sendmail -bs',

'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],

'markdown' => [
'theme' => 'default',

'paths' => [
resource_path('views/vendor/mail'),
],
],
];

Hope it helps.
Kind regards

Expected response code 250 but got code 530, with message 530 5.7.0 Authentication required in Laravel

his error normally occurs when the laravel smtp driver cannot authenticate with the smtp server, and this can be caused by many things, many smtp servers block smtp ports, for example google, but from my experience it is normal for the settings to be wrong.

check that you are using the correct MAIL_ENCRYPTION and check with your smtp service provider that smtp ports have not been blocked for you

Laravel SwiftMailer : Expected response code 250 but got code 530, with message 530-5.5.1 Authentication Required

Try to turn on "less secure apps" of your account on this page. Read this google answer.



Related Topics



Leave a reply



Submit