简体   繁体   中英

Laravel mail localhost it's working fine on godaddy server it giving Connection could not be established with host smtp.gmail.com error

I am trying to make a contact form using laravel mail. It works fine on localhost but, when I host it on godaddy share hosting I returns me an error: Swift_TransportException Connection could not be established with host smtp.gmail.com [Connection refused #111],am tried all the methods which are available in stackoverflow but their is no luck.

You have to configure your google account to accept connexions from your host :

In your Google Email Account > Google Account . On My Account Page click on Security and scroll down to the bottom you will find Less secure app access settings . Click on the radio button to set it ON.

Though you tagged this question with PHPMailer, you're not using it. The problem you have is very well known - GoDaddy blocks outbound SMTP. There is nothing you can do to your script or server to make it talk to gmail. I recommend switching to a proper hosting provider that does not block essential services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM