Using Gmails SMTP servers for Forms in WordPress

I recently was asked to create a custom form for a WordPress installation. Unfortunately, the plug-in I used, ‘Contact Form 7′, refused to work with the client’s web server.

By default, most WordPress plug-ins that send mail use the PHP mail() function. Some servers do have problems with this so I solved it in the following way.

1) I installed the plug-in WP-Mail-SMTP. This allows you to change the default way that your WordPress blog sends email from the PHP function to SMTP.

2) I added the Gmail servers SMTP details to the plug-in:
Host: smtp.gmail.com
Port: 465
Encryption: SSL
Authorisation: YES
Username: client’s email address
Password: client’s password for above email address

Now the Contact Form 7 works! The client uses Google Apps for business so their domain name is set up to use with this, but it will also work with any gmail.com address.

This entry was posted in WordPress. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.