Google has extended their Gmail service to the business sector. Now you can use their email service to outsource and power your business email. You can easily setup personalized email addresses like firstname.lastname@example.org, use the classic Gmail browser interface or any desktop client to read and send emails and have all emails from your WordPress powered website go through their service. Plans start from $5/user/month and a free plan is also available, limited to 10 users, ad-supported and without technical support. There’s a free trial for their premium plan and you can downgrade to the free plan at any time.
There are a lot of benefits in using their service, the best I can think about being not cluttering your server load with emails. Especially if you’re website is on a VPS with limited resources, having additional servers for incoming and outgoing emails running and constantly handling emails could be resource consuming. Better outsource these services to a third party and let the server handle website requests.
Google Apps email service is compatible with any website or server. All you need to do is point the MX records of your DNS entries to their servers and you have a working email. There’s a catch though when it comed to WordPress websites, instructing WordPress to send its own emails through the Google Apps service. Luckily there’s a plugin that handles this smoothly for us. We’ll discus this towards the end of the article, first let’s see how to set up a new Google Apps account:
Setting up a Google Apps Account
First go ahead to the Google Apps home page and select to create a new account. You will be asked for basic some basic information like your name, email address and business name. Afterwards, you will be asked to enter a domain name or to register a new one. At this step enter your website’s domain name as this will be the domain to which you will be assigning email addresses. You will be asked to verify the domain name, in a manner similar to Google Webmaster Tools. Afterwards you will be able to create mailbox accounts. Go ahead and clone all mailbox accounts from your current website. Make sure to complete this step before reassigning your DNS server’s MX records to avoid losing any emails incoming during the transition period.
Pointing your DNS Server’s MX Entries to Google Apps
Now that you have your account and mailboxes set up, go to your hosting’s control panel, to DNS Settings and change the MX records to point to Google. Note that these entries are provided by who is hosting your DNS server which is not necessarily the same service hosting your website. They could for example be your domain registrar or if you are using a service like Cloudflare without registering through a partner then they are hosting your DNS server. The easiest way to find this out is to check where your DNS servers point to.
How these look like may differ for different providers but they should look in essence the same for all. Most probably you should see one single MX record mail.yourdomain.com pointing to yourdomain.com (or your IP address) with priority 10 and TTL 1 dat or automatic. This isn’t necessarily what you have setup, but it’s not important since you need to delete it and any other MX records you may have. Maybe write them down somewhere as backup in case propagating your new entries fails somehow, although improbable. Now add these new MX entries:
ASPMX.L.GOOGLE.COM with priority 1
ALT1.ASPMX.L.GOOGLE.COM with priority 5
ALT2.ASPMX.L.GOOGLE.COM with priority 5
ASPMX2.GOOGLEMAIL.COM with priority 10
ASPMX3.GOOGLEMAIL.COM with priority 10
Click the “Save all entries” button if you have one (entries are usually saved after each modification) and wait for them to propagate. Propagation can take anything from instant to 2 hours, normally it doesn’t take more than 30 minutes. Google Apps can show you where your MX records point to under Setup > Set up your Apps > Gmail > Setup Gmail if you have selected. After propagation is complete you will also see a message “Congratulations! Your MX records are set up correctly”:
Now you should have working email addresses and mailboxes, your Google Apps Setup is complete. There is one more step though if you want to make your WordPress installation work with Google Apps:
Configuring WordPress to integrate with Google Apps
WordPress sends its own email notifications usually when you receive new comments but you may have other functionality enabled such as user registrations or sending newsletters, in which case configuring it to work with Google Apps becomes imperative. Luckily there’s a plugin WP Mail SMTP which can configure WordPress to use an external email outgoing server with SSL and authentication just as we need. Install and activate this plugin, then go to Settings > Email and configure it with the following settings:
Under “From Email” enter the email address you wish to send emails from. By default this is email@example.com but can be any email address, just make sure a mailbox for it exists in Google Apps.
Under “From Name” enter the name you wish to appear in the recipient’s email client. By default this is “WordPress”.
Make sure you have selected “Send all WordPress emails via SMTP”.
Under SMTP Host enter smtp.gmail.com and SMTP port to 465.
Under Encryption select “Use SSL encryption” and under Authentication select “Yes: Use SMTP authentication”.
Then under Username enter your full email address, e.g.: firstname.lastname@example.org and enter the password.
Here’s a screenshot of how the configuration page should look like:
Save the settings and WordPress configuration is complete. Emails sent by WordPress should now be handled by Google Apps.
You can send a test email to see the service is working. It will also show some debug information and please not that just because the first lines say “Test Message Sent. The result was: bool(true)” doesn’t mean the message was actually sent. Check the debug information below to see if there are any other errors and correct them as necessary. The only way to make sure the service actually works is when you have received the test email in your inbox.
You should now have a fully functional email service running through Google Apps. If you were using any email servers on your VPS or dedicated server you may want to stop them and remove them from the system startup table to save resources.