Search code examples
phplaravellaravel-5

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


I got stuck on this error I trying to configure SMTP mail on laravel

here is the error

here is my configuration on .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=fff3c01db52ee0
MAIL_PASSWORD=feaeda91dc9ab6
MAIL_ENCRYPTION=TLS

here is  my mail.php on config

I have to try to authenticate the SMTP on env but I keep getting the same error so for now am stack on that error


Solution

  • 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