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

前端 未结 7 1405
情深已故
情深已故 2020-12-24 01:29

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

\"here

7条回答
  •  一整个雨季
    2020-12-24 02:07

    That is basically authentication error due to misconfiguration of email settings.

    Go to .env file

    change

    MAIL_DRIVER=smtp
    MAIL_HOST=mailtrap.io
    MAIL_PORT=2525
    MAIL_USERNAME=null
    MAIL_PASSWORD=null
    MAIL_ENCRYPTION=null
    

    to

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com    
    MAIL_PORT=465    
    MAIL_USERNAME=ENTER_YOUR_EMAIL_ADDRESS(GMAIL)    
    MAIL_PASSWORD=ENTER_YOUR_GMAIL_PASSWORD    
    MAIL_ENCRYPTION=ssl
    

    The MAIL_USERNAME and PASSWORD should be replaced with your Gmail Email address and Password respectively. Login to your Google Account, Go to security settings and enable Allow Less Secure App switch button.

    After that go to your project root directory and run the following command:

    php artisan clear:cache && php artisan clear:config && php artisan config:cache
    

    . Please refer to

    this guide for assistance and clarification (Note: For MAIL_HOST use smtp.gmail.com)

提交回复
热议问题