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.
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
Laravel cant send mail: Expected response code 250 but got code 530, with message 530 5.7.1 Authentication required ↵
1.change mail driver
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=mymail@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
2.clear config cache
php artisan config:clear
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 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.
Related Topics
How to Use File_Get_Contents or File_Get_Html
Program Cant Start Because PHP5.Dll Is Missing
How to Get the Columns Names Along with Resultset in PHP/Mysql
Http Referer Not Always Being Passed
How to Load the Requested Language File: Language/En/Form_Validation_Lang.Php
Differencebetween .= and += in PHP
Php: Equivalent of Include Using Eval
PHP Code Can Insert Image to Excel File and Open It Correctly in Ms Excel
Date Function to Display All Dates Between Two Dates
Seems Like Post Values Are Lost When .Htaccess Rewriterule Used. Get Values Are Ok. How to Fix
Add X Days to Date, Excluding Weekends
How to Get a List of MySQL Databases in PHP Using Pdo
"Transfer-Encoding: Chunked" Header in PHP
In PHP How to Access a ":Private" Array in an Object