Skip to main content

How to Use Cloudflare Email Routing with Gmail SMTP

mhrsntrk

mhrsntrk / November 11, 2025

Cloudflare Email Routing is a powerful, free tool that lets you create custom email addresses under your domain and route all incoming mail to another inbox, like Gmail. It does not store your emails and works with any inbox you already use. For sending emails from your custom domain, you can easily connect it to Gmail's SMTP service.

Setting Up Cloudflare Email Routing (Receiving Emails)

Enable Email Routing in Cloudflare

  1. Log in to your Cloudflare dashboard and select the domain where you want to set up email routing.
  2. Go to Email > Email Routing.
  3. Click Enable or Add records and enable. This action automatically adds the necessary MX and TXT records to your DNS zone so that Cloudflare can handle email for your domain.

Create a Custom Email Address

  • In the Email Routing section, choose Create address.
  • Enter the custom email address you want (e.g., [email protected]).
  • Enter your destination address (the real inbox where emails will go, such as your Gmail address).
  • Click Save.

Verify Your Destination Address

  • Cloudflare will send a verification email to the provided destination address.
  • Click the verification link in that email to complete the setup.

Ensure MX and TXT Records Are Correct

  • Cloudflare should add the required MX records for routing automatically.
  • Double-check that the MX record points to Cloudflare’s mail servers; this is essential to receive emails.
  • The default TXT record is used for routing verification; leave it unless you need custom SPF/DMARC adjustments.

Test Receipt

  • Send an email to your new custom address.
  • Check your destination inbox—the email should appear there. If it doesn’t, verify DNS records and that your email rule is active in Cloudflare.

Sending Email: Gmail SMTP with Cloudflare Email Routing

Step 1: Enable 2-Factor Authentication

  • Make sure two-factor authentication is on for your Google account.
  • Set it up at Google 2FA Settings.

Step 2: Create an App Password for Gmail

  • Go to Google App Passwords.
  • Select "Mail" as the app, choose your device, and click Generate.
  • Copy the generated password for later use.

Step 3: Add Your Cloudflare Email Address to Gmail

  • Open Gmail and go to Settings → Accounts → Send mail as.
  • Click "Add another email address".
  • Enter your display name and the Cloudflare-routed email address (e.g., [email protected]).
  • Untick "Treat as an alias".
  • Click "Next step".

Step 4: Configure SMTP Server Settings

  • SMTP Server: smtp.gmail.com
  • Port: 587
  • Username: Your full Gmail address (e.g., [email protected])
  • Password: The App Password you created
  • TLS: Enabled
  • Click Add Account.

Gmail will send a confirmation code to your custom email address routed via Cloudflare. Enter the code or click the confirmation link to finish setup.

Step 5: Set up SPF and DMARC Records (Cloudflare DNS)

  • SPF Record (Type: TXT, Name: @, Content:
    v=spf1 include:_spf.mx.cloudflare.net include:_spf.google.com ~all )
  • DMARC Policy (TXT, Name: _dmarc, Content:
    v=DMARC1; p=none; rua=mailto:[email protected] )

This helps your emails pass authentication checks and avoids being blocked or marked as spam.

Usage Tips

  • When composing a new message in Gmail, you can select your domain's custom address in the From field.
  • Replies to emails sent to your custom domain will use your custom address automatically.
  • Cloudflare does not provide an actual mailbox; all mail is forwarded.

Common Issues and Troubleshooting

Cloudflare Email Routing with Gmail SMTP is powerful but not flawless—users often face issues. Here are practical solutions and tips based on community experience and real-world testing.

1. DKIM and Email Authentication Problems

  • Missing DKIM signature: Emails sent using Gmail SMTP through a custom domain often lack a DKIM signature. This can cause emails to get flagged as spam or appear “unverified”—especially in services like Outlook and Hotmail.
  • SPF/DMARC alignment: While SPF and DMARC records may pass, DMARC with p=none is weak. More strict policies (like p=quarantine or p=reject) may cause delivery failures.

Possible solutions:

  • Use an SMTP relay service (Mailjet, SMTP2GO, Mailgun, etc.) that signs emails with DKIM for your domain. Many users report better deliverability and authentication with these platforms.
  • You can generate and add a DKIM record within the Cloudflare dashboard’s email settings. Some users try to copy DKIM public keys using results from tools like mail-tester and manually add them to DNS, but results can be inconsistent.

2. Gmail SMTP Sending Limits and Rate Errors

  • Many users experience temporary “rate limited” errors when Gmail detects unusual volumes or patterns of outgoing mail (421 4.7.28 Gmail has detected an unusual rate of unsolicited mail). Delays and blocks can occur.
  • Google may phase out app passwords for newly created accounts, making this approach unreliable for some users.

Tips:

  • Avoid sending bulk or automated emails via Gmail SMTP to prevent rate limits.
  • Consider switching to a third-party SMTP provider (SMTP2GO, Mailjet, etc.) if Gmail rate limits are a recurring issue.

3. Aliasing and Gmail Behavior

  • Treat as an alias: Leaving this option unchecked in Gmail settings ensures replies from your routed address are consistent. Some users report the need to enable aliasing to resolve Gmail restrictions—experiment to see which works for your configuration.

4. Delivery to Specific Providers

  • Yahoo and Gmail generally accept messages routed this way, but Outlook and Hotmail often mark them as spam or display warnings about authentication.
  • If deliverability is crucial, test with your intended provider(s) and switch to an SMTP service with better alignment if needed.

5. Miscellaneous Issues

  • Some SMTP services, like Mailjet, add CSA-mandated headers (List-Unsubscribe, Feedback-Id). This may not be desirable for direct, non-marketing emails, but is common with certified transactional senders.
  • Occasional persistent issues (e.g., Gmail rejecting alternate sender verification) may force a switch to an Outlook address or another recipient service.

Checking Email Deliverability and Authentication

To ensure your setup is correct—and your emails land in inboxes rather than spam folders—use diagnostic tools like Mail-Tester.

How to Use Mail-Tester

  • Visit mail-tester.com.
  • Copy the unique email address given by the site.
  • Send a test email from your newly configured address via Gmail (using Cloudflare routing).
  • Check your score and review the feedback:
    • SPF, DKIM, DMARC pass/fail status.
    • Spam score and blacklists.
    • Suggestions on authentication records and headers.

Common Findings and Fixes

  • “DKIM missing”: Add DKIM records for your domain in Cloudflare DNS. For some SMTP relays, this is handled automatically.
  • “SPF pass but weak (~all)”: Consider adjusting to -all for stronger alignment if possible.
  • “DMARC policy too weak”: Change p=none to p=quarantine or p=reject for stricter security, but only after extensive testing.

Quick Reference: Recommended SMTP Relays

Based on real user reports, these services help overcome DKIM, rate limits, and deliverability issues:

  • Mailjet (good for Yahoo, Gmail; some quirks for Outlook).
  • SMTP2GO (recommended for reliability and quota).
  • Mailgun (may add CSA headers in future).
  • Outlook SMTP (alternate if Gmail continually rejects mails).

Test each for your specific requirements. Always verify with Mail-Tester after changing settings.


With Cloudflare Email Routing, you gain flexible custom email addresses to receive mail, plus reliable sending capabilities through Gmail SMTP. This setup is private, free, and perfect for anyone seeking more control over branded communication without extra costs or complications.

Use this guide as a reference, and enjoy your new professional email setup!