CH 46 / 50Chapter 8: Hands-On

Create a Custom-Domain Email Address with Email Routing

On this page18 items

You want an email address on your own domain. Traditionally, that meant signing up for a hosting plan or paying a monthly fee for Google Workspace or Microsoft 365. Many people have probably thought, “But I just want one email address.”

Cloudflare Email Routing changes that. No server to rent, no monthly fee, and five minutes of setup get you an email address on your own domain. Incoming mail is forwarded to the Gmail (or similar) account you already use.

The Email Routing page in Chapter 5 explained how it works. This page actually sets it up, and also covers the limits of this approach (it can’t send) along with realistic workarounds.

What you’ll learn on this page#

  • How to enable Email Routing and receive mail on your own domain
  • Registering destination addresses, and why a verification email is required
  • How to use a catch-all (a setting that accepts mail to any address, even ones that don’t exist)
  • The biggest limitation, “it can’t send,” and how to work around it
  • What to watch out for when working on a domain that already uses email

What this approach can and can’t do#

First, let’s set expectations correctly.

Possible?
Receive mail sent to [email protected]Yes
Create multiple addresses for different purposesYes (up to 200 rules per domain)
Receive mail sent to nonexistent addresses in one placeYes (catch-all)
Process received mail programmaticallyYes (Email Workers)
Send as [email protected]Not out of the box (see below)
Store mail on CloudflareNo (forwarding only)

In other words, Email Routing is a receive-only forwarding service. Once you understand that, nothing in the steps below will catch you off guard.

And it’s all free. Within this scope, there are no charges for the number of domains or addresses.

How mail gets delivered through Email Routing

Before you start#

You need two things.

  • A domain managed by Cloudflare (its nameservers must point to Cloudflare)
  • A destination email address (Gmail or whatever you normally use)

Using Cloudflare DNS is mandatory. You can’t use it while staying on another provider’s DNS. If you haven’t switched yet, steps 1 to 3 of Connecting WordPress to Cloudflare will help.

Be careful if the domain already uses email#

If this domain already receives email, going ahead will stop that mail from arriving.

When you enable Email Routing, Cloudflare replaces the MX records with its own. MX records determine “where mail for this domain gets delivered,” so from the moment they’re rewritten, mail arrives at Cloudflare instead of your previous mail server.

Don’t do this on a domain whose email runs on a hosting provider or Google Workspace. Try it first on a domain that doesn’t use email, or on a newly registered one.

Step 1: Enable Email Routing#

In the Cloudflare dashboard, open Compute → Email Service → Email Routing, and select your domain from Onboard Domain.

When you enable it, Cloudflare automatically adds three kinds of DNS records.

RecordRole
MX recordHas mail for this domain delivered to Cloudflare
TXT record (SPF)Declares that Cloudflare is allowed to handle mail for this domain
TXT record (DKIM)Adds a digital signature to forwarded mail to prove it’s legitimate

You don’t need to write any records yourself. With Cloudflare DNS, they usually take effect in about 5 to 15 minutes, and within 24 hours at most.

Step 2: Register a destination address#

Under Destination addresses, register the email address where you want to receive mail.

Once registered, a verification email is sent to that address. Open the link inside and it becomes active.

This verification step has a purpose. Without it, anyone could set someone else’s email address as a destination, turning it into a tool for flooding people with unwanted mail. If the verification email doesn’t arrive, check your spam folder.

You can register up to 200 destination addresses per account.

Step 3: Create rules#

This is the main part. You decide “where to forward mail that arrives at which address.”

On the Routing Rules tab, select Create routing rule and specify the following.

FieldExample
Address to receiveinfo
Domainexample.com
DestinationThe registered [email protected]

Save, and you’re done. Mail sent to [email protected] now arrives in Gmail.

You can create up to 200 rules per domain. Splitting them by purpose is the classic way to use them.

Splitting them by purpose lets you tell where a leak came from. If spam arrives at an address you only gave to one online store, you’ve identified the source of the leak. If you want to make it disposable, just delete that rule.

Step 4: Check that it works#

From a different email account (such as your mobile carrier’s email), send a test message to [email protected].

It should arrive in the destination inbox within a few seconds to a few minutes. Be sure to check your spam folder too.

If it doesn’t arrive, check in this order.

  1. Have the DNS records taken effect (is there a warning in the dashboard)?
  2. Did you open the link in the destination address’s verification email?
  3. Is the rule enabled (Enabled)?
  4. Is the address spelled correctly?

Setting up a catch-all#

Enable Catch-all address to gather all mail sent to the domain in one place, including addresses not listed in your rules.

With this, you can make up any address on the spot in the form [email protected]. It’s handy if you want to use a different address for each service.

But there’s a side effect: spam aimed at nonexistent addresses all gets through too. Attackers send indiscriminately to common names like admin@, sales@ and webmaster@, and with catch-all enabled, all of it flows into your destination.

Unless you have a clear purpose for it, creating rules only for the addresses you need is more pleasant.

The biggest limitation: it can’t send as is#

It can receive, but sending requires a separate mechanism

This is the most important caveat.

Email Routing doesn’t support sending mail from your domain. If you reply to a forwarded message in Gmail, the recipient gets it from [email protected], not from [email protected].

That might not matter for personal correspondence, but it’s fatal for a business inquiry address. You end up with “I contacted info@, and got a reply from some Gmail address I don’t recognize.”

Workaround 1: Use Gmail’s “Add another email address”#

This is the most widely used method. Gmail has a feature that lets you use a different address as the sender.

However, this feature requires the details of an SMTP server for sending, and Cloudflare doesn’t provide one. So you’ll combine it with an external sending service (the free tier of Resend, SendGrid, Amazon SES and so on).

The setup looks like this.

  • Receiving: Cloudflare Email Routing (free)
  • Sending: An external email sending service (most are free up to a certain volume)
  • Using it: Send and receive as [email protected] from the Gmail interface

It takes a little effort, but it’s a popular setup for sending and receiving custom-domain email without paying a monthly fee.

Workaround 2: Wait for Cloudflare’s sending feature#

Cloudflare itself is preparing a sending feature (Email Sending). As of August 2026, it’s in beta and offered for the Workers Paid plan. In the future, this alone may cover everything, but it’s too early to build it into production use right now.

Workaround 3: Accept the limitation#

For uses where “receiving is enough,” it’s fine as is.

  • Addresses for signing up to online stores and services
  • The administrative contact for your domain
  • The contact address for a personal site (with replies sent via a form)

The third one is especially practical. You receive inquiries through a form protected by Turnstile and reply from your usual address.

Going further: Email Workers#

You can also process received mail programmatically.

text14 lines
export default {
    async email(message, env, ctx) {
        const from = message.from;

        // Forward only mail from specific senders
        if (from.endsWith("@example.co.jp")) {
            await message.forward("[email protected]");
            return;
        }

        // Reject everything else
        message.setReject("Not accepted");
    },
};

Just by writing an email handler instead of fetch, you can do the following with incoming mail.

  • Forward it (forward)
  • Reject it (setReject)
  • Reply to it (reply; for mail with DMARC enabled, once per message)
  • Read and process its contents (record it in D1, summarize it with Workers AI and so on)

You can build things like automatically recording inquiry emails in a database or saving attachments to R2, all without a server. The way you write it is the same as in Your first Workers project, two pages back.

Points for beginners to watch#

  • Don’t do this on a domain with existing email: The MX records get replaced, and mail you were receiving stops arriving
  • 25 MiB per message: Mail with attachments larger than this can’t be received
  • Always complete verification of destinations: Mail isn’t forwarded to addresses whose verification link hasn’t been opened
  • Catch-all lets all spam through too: It’s convenient, but your inbox will get messy. Creating only the addresses you need is more pleasant
  • Lose the destination and you can’t receive: If the destination Gmail account becomes unusable, mail for that domain has nowhere to go. For important uses, registering two destinations gives peace of mind
  • Always check the reply-from address: If you reply directly from Gmail, it’s sent from your Gmail address. If you use it for work, finish the sending setup first
  • Due to how SPF works, forwarded mail can be harder to deliver: Cloudflare rewrites the envelope sender as a countermeasure, but the chance that forwarded mail gets flagged as spam isn’t zero

Related services#

Summary#

  • With Email Routing, you can create an email address on your own domain with no server contract and no monthly fee. Setup takes five minutes
  • Cloudflare DNS is required. Don’t do this on a domain that already runs email (the MX records get replaced)
  • Enabling it automatically adds three records: MX, SPF and DKIM
  • A destination address only becomes active once you open the link in the verification email
  • Up to 200 rules per domain. Splitting them by purpose lets you identify leak sources and use disposable addresses
  • Catch-all is convenient, but spam aimed at nonexistent addresses all gets through too
  • It doesn’t support sending. Replies from Gmail are sent from the destination address
  • If you also want to send, combine an external sending service with Gmail’s sender settings
  • With Email Workers, you can process incoming mail programmatically

The biggest value of this feature is that it frees you from “paying a monthly fee just to create one email address.” If you own a domain, it’s worth trying.

There’s one page left in Chapter 8. The last one turns the AI knowledge from Chapter 7 into something real: building an AI that answers questions about your own documents with AI Search.

Read next#