Swift_TransportExceptionConnection could not be established with host smtp.gmail.com
问题 Trying to send email in php. transport: smtp host: smtp.gmail.com username: example@example.com password: password port: 587 encryption: ssl Options already tried: Tried all combinations of port (22, 465, 587) and encryption (No encryption, SSL, TLS) Allow access to less secure apps is on and two ways authentication is off. checked host details: and tried with above host name and ips. Tested mailtrap.io and its working fine! (receiving email in mailtrap inbox, so no issue in code ) I'm using