Knowledge Base

Connect your domain's email to Microsoft 365

6 views Published 7 May 2026

If you'd rather receive (and send) the email for your domain through Microsoft 365 — using Outlook on the desktop, web, and mobile — instead of cPanel webmail, this guide walks through every step we use ourselves.

Heads up: Once mail flow moves to Microsoft 365, your existing cPanel email accounts for that domain stop receiving new mail. Anything already in those mailboxes stays there for archive, but new mail goes to M365. Plan accordingly.

1. Add your domain to the Microsoft 365 tenant

In admin.microsoft.com:

  1. Settings → Domains → Add domain
  2. Enter your domain (e.g. example.co.uk) and click Use this domain.
  3. When asked how to verify ownership, choose Add a TXT record. Microsoft will show you a value like MS=ms12345678 — you'll add this in step 2.
  4. When asked how to connect: choose Add your own DNS records (you have full DNS at Gravity Host already, so don't let Microsoft change your nameservers).

2. Add DNS records via cPanel Zone Editor

In your Gravity Host cPanel, open Zone Editor for the domain. You'll add the records Microsoft showed you in step 1, plus a couple of others:

Type Name Value Priority
TXT@MS=ms12345678 (your value from M365)
MX@example-co-uk.mail.protection.outlook.com0
CNAMEautodiscoverautodiscover.outlook.com
TXT@v=spf1 include:spf.protection.outlook.com -all

Note on the MX value: Microsoft replaces dots with hyphens in your domain when generating its mail-protection hostname. Always copy the exact value from the Microsoft setup wizard — don't construct it yourself.

Note on SPF: If you also send mail from cPanel (e.g. transactional mail from a website on the same domain), use a combined SPF record instead — see "Tips" at the bottom.

3. Set Remote Mail Exchanger in cPanel

This is the step most guides skip — and it causes real problems if you miss it.

Even after the MX record is changed, cPanel by default still treats the domain as a local mail exchanger and tries to deliver any mail it sees to a cPanel mailbox. With Microsoft now hosting the mailboxes, that local delivery silently swallows messages that should have gone to Outlook.

  1. cPanel → Email Routing
  2. Pick the domain
  3. Switch from Local Mail Exchanger to Remote Mail Exchanger
  4. Save

From this point cPanel honours the MX record and stays out of the way.

4. Verify in Microsoft 365 and add mailboxes

  1. Back in admin.microsoft.com → Domains → click Continue / Verify. Microsoft will check the records you added in step 2. Domain status flips to Healthy.
  2. Add your email addresses for the domain. Two common patterns:
    • Existing licensed mailbox + alias: open the user, Manage username and email, add an alias like info@yourdomain.co.uk. Free — no extra licence.
    • Shared mailbox: Teams & groups → Shared mailboxes → Add. Use this for addresses like support@ that multiple people read. Up to 50 GB, free, no licence consumed.

5. Optional — catch-all to one mailbox

If you want every address at your domain (whether you've created it or not) to land in a single inbox, add a Mail Flow rule:

  1. Exchange admin → Mail flow → Rules → Add rule → Create a new rule
  2. Apply if: The recipient → address contains any of these wordsyourdomain.co.uk
  3. Do this: Redirect the message to → your catch-all mailbox
  4. Except if: The recipient is → the same catch-all mailbox (prevents redirect loop)
  5. Save and toggle the rule On in the Rules list

6. Optional — send transactional email from your website through M365

If your website sends emails (contact forms, order receipts), they go via cPanel's mail relay by default. If you'd rather send them through Microsoft so they share the same reputation as your inbox replies, you can route the website's outbound through your M365 tenant via an Inbound connector.

This is more advanced and Microsoft account-specific — open a support ticket with us and we'll walk you through it.

Tips and gotchas

Combined SPF when you still send from cPanel

If your website on cPanel sends transactional email and your inbox is on Microsoft 365, the M365-only SPF record will mark website mail as failing SPF. Use this combined version instead:

v=spf1 +a +mx +include:relay.mailchannels.net +include:spf.protection.outlook.com ~all

Add DKIM

Microsoft generates two CNAME records for DKIM signing. In Microsoft Defender → Email & collaboration → Policies → Email authentication → DKIM, select your domain, click Create DKIM keys, then add the two CNAMEs Microsoft shows you to your Zone Editor. Toggle DKIM on after they resolve. This visibly improves Gmail/Yahoo deliverability.

Existing cPanel mailbox migration

If you have mail in cPanel mailboxes that you want preserved in Outlook, set up the new Microsoft mailbox first (with IMAP enabled), then connect both as IMAP accounts in a desktop mail client (Outlook, Thunderbird) and drag-and-drop the folders. That copies the mail over before you flip the MX.

Mail "missing" after MX flip

If mail starts disappearing after the MX change, almost always one of two things:

  1. Remote Mail Exchanger isn't set — see step 3 above. cPanel is still trying to deliver locally.
  2. The recipient address doesn't exist in M365 yet — Microsoft rejects mail to unknown mailboxes. Add the address as a mailbox or alias, or set up the catch-all rule in step 5.

Verification taking ages

DNS changes via cPanel propagate within a couple of minutes for our nameservers, but external resolvers cache the old values. Use a tool like dig TXT yourdomain.co.uk @1.1.1.1 or whatsmydns.net to check what public DNS sees.

Need help?

Open a ticket and we'll walk through it with you, or do the M365 setup for you on request — most domains are ready in about 30 minutes.

Was this article helpful?

I need more help

Related Articles

How to Set Up Automatic Billing for Your Invoices How to Reset Your Client Area Password How to Block or Filter Unwanted Emails (Spam) in Your Inbox