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

前端 未结 13 1187
别那么骄傲
别那么骄傲 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:32

    My solution was to change:

      'driver' => 'smtp',
    

    to

     'driver' => 'mail',
    

    In app/config/mail

    Hope that helps

    0 讨论(0)
  • 2020-12-03 05:33

    I just had this issue and solved it by editing mail.php under config folder. Usually when using shared hosting, they hosting company allows you to create an email such as

    XXXX@yourdomainname.com

    . So go to email settings under you shared hosting cpanel and add new email. Take that email and password and set it in the

    mail.php.

    It should work!

    0 讨论(0)
  • 2020-12-03 05:34

    I had the same issue when I was using Godaddy web hosting and solved this by editing my .env file as,

    MAIL_DRIVER=smtp
    MAIL_HOST=XXXX.XXXX.in
    MAIL_PORT=587
    MAIL_USERNAME=dexxxxx
    MAIL_PASSWORD=XXXXXXXX
    MAIL_ENCRYPTION=tls
    

    Where MAIL_HOST is your domain name from Godaddy, MAIL_USERNAME is your user name from Godaddy and MAIL_PASSWORD is your password from Godaddy.

    I hope this may help you.

    0 讨论(0)
  • 2020-12-03 05:35

    I had the same problem for a while, replacing: smtp.gmail.com with 173.194.65.108 actually worked for me!

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-03 05:38

    tcp:465 was blocked. Try to add a new firewall rules and add a rule port 465. or check 587 and change the encryption to tls.

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