Swift_TransportException Connection could not be established with host smtp.gmail.com

前端 未结 13 1252
别那么骄傲
别那么骄傲 2020-12-03 05:00

I can\'t figure for the life of me why exactly is it failing.. this is the exact error I am getting:

Fatal error: Uncaught exception \'Swift_TransportExcepti         


        
13条回答
  •  攒了一身酷
    2020-12-03 05:35

    In my case, I was using Laravel 5 and I had forgotten to change the mail globals in the .env file that is located in your directory root folder (these variables override your mail configuration)

       MAIL_DRIVER=smtp
       MAIL_HOST=smtp.gmail.com
       MAIL_PORT=465
       MAIL_USERNAME=yourmail@gmail.com
       MAIL_PASSWORD=yourpassword
    

    by default, the mailhost is:

       MAIL_HOST=mailtraper.io
    

    I was getting the same error but that worked for me.

提交回复
热议问题