# Use Google Workspace for your email
Source: https://docs.webgee.com/en/email/how-to-configure-email-routing-and-mx-records-for-google-mail



Keep your website on WebGee while your email is handled by Google Workspace.
Applies to any domain with DNS managed in cPanel.

Two changes are needed, and doing only one is the usual cause of mail
disappearing: tell cPanel not to deliver mail locally, then point the MX records
at Google.

## 1. Set mail routing to remote [#1-set-mail-routing-to-remote]

Without this, cPanel sees your own domain in its list and delivers mail to a
local mailbox instead of sending it on to Google. Messages between addresses on
your own domain then never leave the server, while external mail arrives at
Google — so the mailbox looks half-broken.

1. In cPanel, open **Email Routing** under **Email**.
2. Select your domain.
3. Choose **Remote Mail Exchanger**.
4. Select **Change**.

## 2. Replace the MX records [#2-replace-the-mx-records]

1. In cPanel, open **Zone Editor → Manage** for the domain.
2. **Delete the existing MX records.** Leaving old ones in place means some mail
   is still delivered to WebGee.
3. Add Google's MX records, which are listed in
   [Google's own documentation](https://support.google.com/a/answer/174125).
   Use the values there rather than any you find elsewhere — Google has changed
   them over time.

## 3. Update your SPF record [#3-update-your-spf-record]

Google needs to be authorised to send as your domain, or your outgoing mail will
fail SPF checks at the receiving end:

```
v=spf1 include:_spf.google.com ~all
```

If your website also sends mail — contact forms, order confirmations — include
WebGee as well. See
[SPF records for WebGee hosting](/en/email/what-are-the-correct-spf-records-when-using-webgee-hosting).

## Check it worked [#check-it-worked]

```bash
dig +short MX example.com
```

You should see only Google's servers, with no WebGee hostnames left.

Then send a message to an address on the domain from an outside account, and
confirm it arrives in Google rather than in cPanel webmail.

## If mail still arrives at WebGee [#if-mail-still-arrives-at-webgee]

* **Email routing is still Local.** Re-check step 1 — this is the most common
  cause.
* **An old MX record survived.** Check the zone again.
* **DNS has not propagated.** Allow up to an hour.

## Before you switch [#before-you-switch]

Migrate any existing mail out of your WebGee mailboxes first. Once MX records
point at Google, new mail goes there and the old mailboxes stop receiving — but
their existing contents stay where they are. See
[Migrate email from another provider](/en/email/migrating-emails-from-imap-providers-using-our-migration-center).

## Related [#related]

* [Configure email routing in cPanel](/en/email/how-do-i-configure-my-email-routing-in-cpanel)
* [SPF records for WebGee hosting](/en/email/what-are-the-correct-spf-records-when-using-webgee-hosting)
