According to this
Gmail SMTP Server could also be used to relay messages from your device or application. You can connect to Gmail mail servers using SMTP, SSL/TLS. If you connect using SMTP, you can only send mail to Gmail or Google Apps users; if you connect using SSL/TLS, you can send mail to anyone.
If your device or application supports SSL - connect to smtp.gmail.com on port 465.
So I tried connecting to smtp.gmail.com on port 465. I got the following error:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Some code uses another address "ssl://smtp.gmail.com".
When I use ssl://smtp.gmail.com also on port 465, my application now works correctly.
- What's the difference between ssl://smtp.gmail.com and smtp.gmail.com if the latter also uses ssl?
- Why can't we send emails to other domains without SSL? Is this only done by gmail for security purposes?
I am extremely new at this. Can anyone explain? I am using php if it matters.