📧🌐How to Setup Custom Email Using Domain + Gmail

So basically, use your own domain (e.g. [email protected]) to receive and send email completely free using Cloudflare Email Routing and Gmail SMTP.

Overview

This setup combines three things:

  • Cloudflare Email Routing: receives email sent to your domain and forwards it to your Gmail
  • Gmail SMTP: lets Gmail send outbound email from your domain address
  • DMARC DNS record: tells receiving servers your domain is legitimate, preventing your emails from being blocked

Prerequisites:

  • Your domain’s DNS is managed by Cloudflare (nameservers pointing to Cloudflare)
  • You have a Gmail account 2-Step Verification is enabled on your Google account

1. Receive Email (Cloudflare Email Routing)

Step 1: Enable Email Routing

  • Go to dash.cloudflare.com and select your domain
  • In the left sidebar, click Email => Email Routing
  • Click Get Started

Step 2: Delete conflicting DNS records (if any)

  • If Cloudflare will show a “Conflicting records” section. These are existing MX and TXT (SPF) records that will break Email Routing if left in place.
  • Click Delete next to each conflicting record (typically one MX and one TXT record)

⚠️ This is safe, these old records will be replaced by Cloudflare’s own routing records in the next step.

Step 3: Add the required DNS records (if applicable)

  • Scroll down to the “Required records” section. You’ll see MX TXT records all marked as Missing.
  • Click “Add records and enable” (or “Automatically add records”), Cloudflare adds all 5 records in one click.
  • Wait a few seconds and confirm all records show Active status.

Step 4: Create a forwarding rule

  • Under Routing Rules, click Create address
  • In Custom address, type the prefix you want, e.g. ahmad (becomes [email protected])
  • Set Action to Send to and enter your personal Gmail address
  • Click Save

Step 5: Verify your destination Gmail address

  • Cloudflare will send a verification email to your Gmail asking you to confirm it as a forwarding destination.
  • Check your Gmail inbox for an email from Cloudflare
  • Click the verification link inside it

⚠️ Do not skip this step. If the destination address is unverified, Cloudflare will not forward anything and senders will get an error.

Step 6: Test receiving

  • Send a test email to [email protected] from any address. It should land in your Gmail inbox within a minute.

💡 If you get a bounce error right after setup, wait 5–15 minutes for DNS to propagate before troubleshooting. MX record propagation is usually fast but not instant.

2. Send Email from Gmail Using Your Domain

Step 1: Create a Google App Password

⚠️ If App Passwords is not visible, first enable 2-Step Verification at https://myaccount.google.com/security, then return here.

Step 2: Add your domain address in Gmail

  • Open Gmail => click the ⚙️ gear icon (top right) => See all settings
  • Go to the Accounts and Import tab
  • Under Send mail as, click Add another email address
  • Enter your name and [email protected]
  • Uncheck “Treat as an alias” => click Next Step
  • Fill in the SMTP details:

SMTP Server: smtp.gmail.com
Port: 587
Username: Your full personal Gmail (e.g. [email protected])
Password: The 16-character App Password from Step 1
Connection: TLS

  • Click Add Account

Step 3: Verify ownership

  • Gmail sends a confirmation code to [email protected], which now forwards to your Gmail inbox via Cloudflare.
  • Open the verification email in Gmail
  • Click the verification link

Step 4: Set as default sender (optional but recommended)

  • Still in Settings => Accounts and Import
  • Under “Send mail as” => “When replying to a message” choose “Reply from the same address to which the message was sent”
  • This means when someone emails [email protected], your reply automatically comes from [email protected], no manual switching needed.

3. Fix DMARC (Required to Avoid Emails Being Blocked)

Without a DMARC record, some receiving mail servers (including Gmail) will block your outbound emails with error: Unauthenticated email from yourdomain.com is not accepted due to domain’s DMARC policy.

  • Add a DMARC record manually in Cloudflare DNS
  • Go to DNS => Records => Add record
  • Fill in:

Type: TXT
Name: _dmarc
Content: “v=DMARC1; p=none; rua=mailto:[email protected]
TTL: Auto

  • Click Save

💡 p=none is the safest starting policy, it monitors without blocking anything. You can tighten it to p=quarantine or p=reject later once you’re confident everything is working.
⚠️ Cloudflare’s DMARC Management UI (Email => DMARC Management => Enable DMARC) may take longer to propagate or behave inconsistently. Adding the TXT record manually via DNS is more reliable and produces the same result.

Leave a Reply

Your email address will not be published. Required fields are marked *