Failed to authenticate on SMTP server error using gmail

后端 未结 8 633
鱼传尺愫
鱼传尺愫 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:14

    Nothing wrong with your method, it's a G-mail security issue.

    1. Login g-mail account settings.

    2. Enable 2-step verification.

    3. Generate app-password.

    4. Use new-generated password in place of your real g-mail password.

    Don't forget to clear cache.

    php artisan config:cache.
    php artisan config:clear.
    
    MAIL_DRIVER=smtp
    MAIL_HOST=mailtrap.io
    MAIL_PORT=587
    MAIL_USERNAME=yourgmailid@gmail.com
    MAIL_PASSWORD=generatedAppPassword
    MAIL_ENCRYPTION=tls
    

提交回复
热议问题