Failed to authenticate on SMTP server error using gmail

后端 未结 8 473
鱼传尺愫
鱼传尺愫 2020-12-23 09:34

I\'m trying to set up email for my first laravel project, and was thrilled that there\'s a laracast for it: https://laracasts.com/lessons/mailers

I\'ve followed the

相关标签:
8条回答
  • 2020-12-23 10:36

    I had the same issue, but when I ran the following command, it was ok:

    php artisan config:cache
    
    0 讨论(0)
  • 2020-12-23 10:38

    Did you turn on the "Allow less secure apps" on? go to this link

    https://myaccount.google.com/security#connectedapps

    Take a look at the Sign-in & security -> Apps with account access menu.

    You must turn the option "Allow less secure apps" ON.

    If is still doesn't work try one of these:

    • Go to https://accounts.google.com/UnlockCaptcha , and click continue and unlock your account for access through other media/sites.

    • Use double quote in your password: "your password"

    And change your .env file

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=587
    MAIL_USERNAME=dianexxxxx@gmail.com
    MAIL_PASSWORD=xxxxxx
    MAIL_ENCRYPTION=tls
    

    because the one's you have specified in the mail.php will only be used if the value is not available in the .env file.

    0 讨论(0)
提交回复
热议问题