Getting php mail() function running on Windows 8.1 with WAMP Server and configuring it to use Gmail’s SMTP servers

With the next Barcamp Bangalore looming round the corner, I'd pitched in to help with some of the website tasks. I installed the traditional WAMP stack with WAMP Server for Windows and started working with WordPress. Needed to get the email notifications working, saw that it wasn't. Bit of research & found that I'd need a SMTP server or an equivalent of sendmail.

All the cool kids seem to be using Fake sendmail – I tried it to use with Gmail's SMTP servers which uses authentication & TLS. Fake sendmail either would crash repeatedly or give a Socket Error # 10060 Connection timed out error.

Finally, after much trawling the Intarwebz, going through many forums & Stack Overflow posts, finally found this blog post which recommends using stunnel.

So this is what my php.ini settings look like:

Yes, all parameters, except for sendmail_form & sendmail_path are commented. They are set in sendmail.ini & stunnel.