How to use Google Apps as an external Email Service for your WordPress Website

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 [email protected], 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 wordpress[email protected] 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.: [email protected] 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.

19 thoughts on “How to use Google Apps as an external Email Service for your WordPress Website

  1. Your explanation and instructions are very clear – amongst the best I’ve seen for explaining the workaround for this problem. However, I still can’t get email to go through. Here’s the error message I get when I try to send the test email:

    SMTP -> ERROR: Failed to connect to server: Connection timed out (110)

    Do you have any suggestions on how I can fix this? Thanks!

  2. Do I need to use a hosting service from another company to use Google business apps? Or just purchase the domain and Google will host it for 5 dls

    I do not plan to have a website yet so I just need to use the email with the registered domain.

    So I can cancel the hosting service (annual payment) and just pay 5 dls a month

    Thank you

    1. What you need to use Google Apps is to be able to edit your DNS records and point the MX records to Google. Most domain registrars offer free DNS service so you shouldn’t need a hosting account.

  3. Thank you.
    Been having issues with emails submitted through WordPress were not reaching us. Your article has helped us resolve the issue.
    Much appreciated.

  4. It’s all working perfectly a part the Reply-To. When I get an email I can reply only to my email address, is there a way to fix this problem?

    Thanks in advance

  5. Thanks for the info. It’s very useful.

    I want to know how can i use the service for a few of people of my team and leave the others in the standard mail of the hosting service.

    Can someone tell me if that is possible?

    Thanks a lot!

  6. When configured, can new email accounts be setup in gmail or do they still need to be setup in wordpress.

    Thanks in advance

    1. The account needs to be created in Gmail and it’s enough to be used as a standard email address. The plugin configuration in WordPress in only to allow WordPress to use it.

  7. Thanks for the detailed information.
    Making my life easy and saving me lots of time, as I can read my email while I am on train to work and back home.
    Cheers,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Current day month ye@r *