Namecheap + WordPress + Google Apps

Namecheap Hosting and WordPress email with Google Apps

Trying to get your WordPress to send emails via Google Apps on a Namecheap Shared Hosting account? This post might help if the SMTP plugins didn’t do the trick.

We use and love Namecheap. We also recommend and encourage WordPress. The two are great for the groundwork of a website: domain registrar, shared hosting, and open-source (free) web software on which to build it all (and it’s fun, too).

Including Google’s Services through Google Apps is something we also like to consider and offer. The Standard Edition, with up to 10 users, is free for anyone. However, a little trick may be required if a site would like to combine Namecheap Shared Hosting, WordPress software and Google Apps.

WordPress ‘wp_mail’ Script

When a new user registers for a WordPress site, WordPress runs the wp_mail script to send them a confirmation email to activate their account. For their shared servers, however, Namecheap has

“disabled sending any emails with the field ‘FROM’ containing [an] email address on the domain that does not exist on the server.”

Unfortunately in this case, standard setup for Google Apps email means that the “domain” for email does not exist on their server. Namecheap explains,

“We have taken these measures due to mass SPAM sending through forums, guestbooks, contact forms scripts on our servers.”

Is All Hope Lost?

No, and that’s good news. It does mean, however, that the standard Google Apps MX Records (i.e. ASPMX.L.GOOGLE.COM) are no longer necessary in your Namecheap shared hosting setup, most often managed through cPanel.

In order for WordPress to be able to send out registration confirmation emails, etc. with Namecheap as the host on a shared server (VPS Hosting does not require this), the emails must live on Namecheap servers. The MX Records must not point to Google’s servers.

What about SMTP plugins for WordPress?

Unfortunately, well-made plugins like WP Mail SMTP or Configure SMTP work great but still depend on the script, which Namecheap has disabled on their servers. Mail Relay is also prohibited. Again, this only applies to Namecheap’s Shared Hosting accounts.

Can I even use Google Apps then?

Without the MX Records pointing to Google servers, no mail will be received in your Google Mail.

“So do I have to give it up altogether for email?”

This is where the good part comes in.

The Key

Go ahead and let your emails live on the Namecheap servers – I know it sounds weird to say, but there is a provision. Following the short list below, which includes Google’s instructions on Configuring dual delivery – Legacy server primary, will help make it all work.

  1. Set your email MX records to point to your Namecheap Server: “Priority: 0” and “Destination: yourdomain.com”
  2. On your server, create each of the email addresses you’d like for your domain (through cPanel, etc.): example@yourdomain.com
  3. In Google Apps, create each of the email addresses you’d like for your domain (assuming you’ve already set up Google Apps) and activate your Test domain alias in Domain Settings > Domain Names of your Google Apps Dashboard.
  4. On your server, forward each of the Email addresses you’ve created to the Domain Alias for your Google Apps users. Google creates a domain alias when you sign up for Google Apps, which simply adds “.test-google-a.com” to the normal email address for your users (i.e. user@yourdomain.com.test-google-a.com). Follow instructions in the Google help document Configure dual delivery – Legacy server primary.
  5. Test and enjoy.

Everything is working for us. Email servers are pointing to Namecheap, WordPress is sending out registration emails, and Google Apps is getting all emails address to example@ourdomain.com even via Domain Alias.

Awesome.

  • jaime_moscoso

    Thankyou! This worked for my Joomla site.

    • You bet, Jaime – glad to hear (and know) it!