Setting Up Google Apps Email with cPanel
September 9th, 2010

Google Apps is one of the best email services. While having your email hosted on the same server as your website is convenient, in reality, it’s not always the wise choice. The following are a few reasons to make the switch, and how to do it – if your host provides cPanel.
Reasons to Switch to Google Apps
- Reliability – Gmail has proven to be a very reliable email service.
- Less Spam – Keep unwanted messages out of your inbox with Google’s innovative spam filter technology.
- Clogged Email Queues – With the potential of hundreds of other accounts on the same server as you, resources often dry up. This can occur due to a spammer or a hacked script, thus resulting in backed-up email queues.
- Blocked IP Addresses – Spammers or a hacked script/site cause all kinds of problems, and spam sent from one server often can get multiple servers with similar IPs blocked. Thus, your email can be affected even if your server or domain wasn’t even the problem.
- Storage Space – With a whopping 7500+ MB of storage that Google gives you – for each email account – you may never have to delete another email again.
- Portability – Setup to receive IMAP and/or POP email, and you can also use their browser based client to get/store your email.
- Service & Support – If there is a problem, it most likely effects everyone using Gmail – so you can be assured Google is probably already aware of it, and a fix is in the works.
- Server Limits – Most hosting providers limit the number of emails sent per domain per hour; in-order-to prevent spammers. For organizations with many email accounts or that send out newsletters, this can be a problem.
Before Making the Switch
- Sign-up for a free Google Apps Standard Edition account
- Make sure to verify domain ownership once your account is setup
- Setup all your email addresses in your Google Apps dashboard
- Follow the remaining steps in the setup guide per the dashboard
(help with MX, CNAME & SPF Records is provided below) - Download and backup your current email
Setting Up Your Email Server
Step for managing your domain’s email in the Google Apps dashboard pretty straightforward. However, setup of your MX, CNAME, and SPF records can be quite confusing. The following will guide you through the process:
MX Records:
Login to your cPanel at www.your-domain.com/cpanel
(of-course replace your-domain.com with your actual domain)- Click on the “MX Entry” icon under the “Mail” section
- Change the Email Routing setting to “Automatically Detect Configuration”
- Remove any existing MX records – see Fig #1
- Add the following seven MX records to your DNS zone file – see Fig #2:
| MX Server address | Priority |
|---|---|
| ASPMX.L.GOOGLE.COM | 10 |
| ALT1.ASPMX.L.GOOGLE.COM | 20 |
| ALT2.ASPMX.L.GOOGLE.COM | 20 |
| ASPMX2.GOOGLEMAIL.COM | 30 |
| ASPMX3.GOOGLEMAIL.COM | 30 |
| ASPMX4.GOOGLEMAIL.COM | 30 |
| ASPMX5.GOOGLEMAIL.COM | 30 |

Fig. #1: Email Routing

Fig. #2: cPanel MX Records
By default, your email is now accessible via http://mail.google.com/a/your-domain.com. However, you can also easily redirect it to http://mail.your-domain.com by changing your CNAME records.
CNAME & SPF Records
Click on the “Advanced DNS Zone Editor” icon in the “Domains” section- Edit “mail.your-domain.com” so it points to “ghs.google.com” – Fig #3
- Add a SPF TXT record for “your-domain.com” so that it points to
"v=spf1 include:_spf.google.com ~all"
Note the quotes are required here.

Fig. #3: Zone File Records
Note you can also setup custom subdomains for the other Google App services (calendar, docs, etc.) by following the same steps you followed to set up your custom “mail” subdomain. For instance, if you want to use calendar.your-domain.com to access your Google Apps calendar, you can add a new CNAME record for “calendar” as shown in Fig #3.
Conclusion and Resources
At this point, you’re pretty much done. You now simply have to wait up to 48 hours before the changes to propagate.
Once the changes have completed, you can set up your email client (Outlook, Thunderbird, Mail, etc.). The Gmail IMAP settings are fairly simple. They are as follows:
IMAP (incoming) mail:
- Server: imap.gmail.com
- Port: 993
- Encryption: SSL
SMTP (outgoing) mail:
- Server: smtp.gmail.com
- Port: 465 or 587
- Encryption: TLS
Google provides instructions for configuring mail clients, including specific email clients.
More Information
Posted in General. ⋅ Tags: email, google apps
3 Responses to “Setting Up Google Apps Email with cPanel”

October 18, 2010 at 5:12 PM
Hey there, thanks for this, it was really useful. One small note though, in the text you have your spf record set to _spf.google… (which I believe is correct) but in your screenshot you have it set to aspmx.google…
Anyway, always useful to find well written clear helpful posts like this :)
October 21, 2010 at 11:07 AM
Tony – good eye. They both work, however Google now recommends replacing
aspmx.googlemail.comwith_spf.google.com. I’ve also seenv=spf1 a include:aspmx.googlemail.com include:_spf.google.com ~allused.The fig. #3 image has been updated.
July 26, 2011 at 7:05 PM
Will definitely try this out