Skip to content
Advertisement

How to fix Connection could not be established with host smtp.gmail.com in php

Good day guys. I’m trying to send email to the new user after registration on PHP website. The user record is submitting to databse but am getting error sending email to user; Uncaught Swift_TransportException: Connection could not be established with host smtp.gmail.com. I really need your help. below is my code

JavaScript

Advertisement

Answer

You should use port 587 instead and tls or ssl would have same behaviour:

https://support.google.com/mail/answer/7126229?hl=en

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement