Failed to authenticate on SMTP server error using gmail

后端 未结 8 575
鱼传尺愫
鱼传尺愫 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条回答
  •  -上瘾入骨i
    2020-12-23 10:31

    I had the same problem and I've already tried everything and nothing seemed to work until I just changed the 'host' value in config.php to:

     'host' => env('smtp.mailtrap.io'),
    

    When I changed that it worked nicely, somehow it was using the default host " smtp.mailtrap.org" and ignoring the .env variable I was setting.

    After making some test I realize that if I placed the env variable in this order it would worked as it shoulded:

    MAIL_HOST=smtp.mailtrap.io

    
MAIL_DRIVER=smtp

    
MAIL_PORT=2525


    MAIL_USERNAME=xxxx

    
MAIL_PASSWORD=xxx

    
MAIL_ENCRYPTION=null

提交回复
热议问题