Saturday, August 10, 2013

How To Use Gmail With SSL In WAMP

I was having a heck of a time figuring out how to get my MyBB forum software to send its email out using Gmail as the provider, but using encryption. It's easy to have it send by default, but I wanted it to use encryption! I didn't care whether it used TLS or SSL, just as long as it was using something secure.

TLS was something I never could get working. I don't know if there is a PHP extension for TLS, but there is for SSL, so that's what I went with.

1. Enable SSL with PHP

Start with the WAMP control panel in the system tray, like so:

Then look for this line in php.ini and delete the semi-colon for open_ssl.dll, commenting the line in, as shown below:

Go back into the control panel and select "Restart All Services" to make PHP pickup the change.

Your PHP should now be configured for SSL, and now all you have to do is use the right SMTP settings, and you're all set!

2. Use These SMTP Settings For Gmail

User Name:*
Password: [your password]
Port: 465
Encryption: SSL

*NOTE: If you are using Gmail with a custom domain, use "" for the user name, or whatever the contact email for your domain is. If' it's just a plain Gmail account, use your gmail acount.

3. Try A Test Email

Did it work? If not, for MyBB, go into the admin system under Tools And Maintenance-->System Mail Log to look for any errors that would give you a clue as to where you went wrong. The hardest part for me in this process was figuring out how to enable SSL for PHP. That, and I had to use the TLS port of 465, which is one of Gmail's quirks.

No comments:

Post a Comment