Skip to content

Route emails

Set up email routing to forward incoming emails to existing mailboxes or process them with Workers.

Route incoming emails sent to your domain to existing mailboxes, Workers for processing, or other destinations.

Prerequisites

  1. Sign up for a Cloudflare account.
  2. Install Node.js.

Node.js version manager

Use a Node version manager like Volta or nvm to avoid permission issues and change Node.js versions. Wrangler, discussed later in this guide, requires a Node version of 16.17.0 or later.

Set up your domain

Before using Email Routing, you need to configure your domain.

  1. In the Cloudflare dashboard, go to Email Routing.

    Go to Email Routing
  2. Select Onboard Domain.

  3. Choose a domain from your Cloudflare account.

  4. Select Continue to proceed with DNS configuration.

  5. Select Add records and onboard. This will add the following DNS records to your root domain:

    • MX records to route incoming emails to Cloudflare.
    • TXT record for SPF to authorize email routing.
    • TXT record for DKIM to provide authentication for routed emails.

Once your domain is onboarded, you can start routing emails.

Route your first email

You can route your first email by setting up forwarding rules in the dashboard, or by processing emails with Workers.

The simplest way to route emails is forwarding them to existing email addresses.

Create a forwarding rule

  1. In the Cloudflare dashboard, go to Email Routing.

    Go to Email Routing
  2. Select the domain you want to create an email address for.

  3. Select the Routing Rules tab.

  4. Select Create Address.

  5. Configure your first rule (for instance, forwarding emails to support@yourdomain.com to your personal email address):

    • Custom address: Enter the local part of the email (for example, support for support@yourdomain.com)
    • Action: Send to an email
    • Destination: Your personal email address (for example, your-email@gmail.com)
  6. Select Save.

Test your forwarding rule

Verify that your routing rule is working:

  1. Send an email from another email account to your newly created address (for example, support@yourdomain.com).

  2. Check the destination inbox for the forwarded email.

  3. If you do not see the email right away, check your spam folder.

Next steps

Now that you can route emails, explore advanced features: