Home Portfolio Electronics Projects Embedded Systems CS Projects IoT & Security Blog About Contact
 Home How to Use a Custom Domain Email with Gmail Using Cloudflare Email Routing

How to Use a Custom Domain Email with Gmail Using Cloudflare Email Routing

March 05, 2026 Umayanga 0 comments

If you own a domain and want to use an email address like contact@yourdomain.com inside Gmail, you can do it for free using Cloudflare Email Routing and Gmail SMTP.


With this setup you can:

- Receive emails sent to your custom domain directly in Gmail

- Send emails from Gmail using your custom domain address

- Avoid paying for Google Workspace


This guide explains the complete setup step-by-step.


--------------------------------------------------


HOW THE EMAIL SYSTEM WORKS


Incoming email flow


Sender → Domain MX Records → Cloudflare Email Routing → Gmail Inbox


Outgoing email flow


Gmail → Gmail SMTP Server → Recipient


Cloudflare handles email forwarding while Gmail handles sending emails.


--------------------------------------------------


REQUIREMENTS


Before starting make sure you have:


- A registered domain

- DNS managed through Cloudflare

- A Gmail account


Services used in this tutorial:


Cloudflare Dashboard

Gmail


--------------------------------------------------


STEP 1 — CONFIGURE EMAIL ROUTING IN CLOUDFLARE




Cloudflare Email Routing allows you to forward emails from your domain to another email address such as Gmail.


Open the Cloudflare dashboard:


https://dash.cloudflare.com/


Select your domain.


Then go to:


Email → Email Routing


Documentation:

https://developers.cloudflare.com/email-routing/


Click Enable Email Routing.


Cloudflare will automatically create the required MX records.


Example:


MX 10 route1.mx.cloudflare.net

MX 20 route2.mx.cloudflare.net


These records allow Cloudflare to receive email for your domain.


--------------------------------------------------


ADD A DESTINATION EMAIL ADDRESS


Add your Gmail address as the destination email.


Example:


Destination email: yourgmail@gmail.com


Cloudflare will send a verification email.


Open Gmail and confirm the verification.


--------------------------------------------------


CREATE A CUSTOM EMAIL ADDRESS


Next create a routing rule.


Example:


Custom address: contact@yourdomain.com

Destination: yourgmail@gmail.com


Now any email sent to contact@yourdomain.com will automatically appear in your Gmail inbox.


--------------------------------------------------


STEP 2 — CREATE A GOOGLE ACCOUNT USING YOUR CUSTOM DOMAIN EMAIL




Next create a Google account using your custom domain email address.


Open the signup page:


https://accounts.google.com/signup


Click:


Use my current email address instead


Enter your custom domain email:


contact@yourdomain.com


Google will send a verification code which will arrive in your Gmail inbox through Cloudflare forwarding.


--------------------------------------------------


ADD PROFILE PICTURE


Open:


https://myaccount.google.com/


Navigate to:


Personal Info → Profile Picture


Upload your profile image.


This profile picture will appear when you send emails from this address.


--------------------------------------------------


STEP 3 — GENERATE A GMAIL APP PASSWORD


To send emails using Gmail SMTP you must create an App Password.


Open:


https://myaccount.google.com/apppasswords


Steps:


Security → Enable 2-Step Verification

Security → App Passwords


Create a new app password.


Select:


App: Mail

Device: Other (Custom)


Google will generate a 16-character password.


Example:


abcd efgh ijkl mnop


Save this password because it will be used later.


--------------------------------------------------


STEP 4 — ADD CUSTOM EMAIL ADDRESS IN GMAIL





Open Gmail:


https://mail.google.com/


Go to:


Settings → See all settings → Accounts and Import


Find the section:


Send mail as


Click:


Add another email address


--------------------------------------------------


ENTER YOUR CUSTOM EMAIL


Fill the form:


Name: Your Name

Email: contact@yourdomain.com


Continue to SMTP configuration.


--------------------------------------------------


CONFIGURE SMTP SERVER


Use Gmail SMTP settings:


SMTP Server: smtp.gmail.com

Port: 587

Username: yourgmail@gmail.com

Password: App Password


Important:


Username must be your Gmail address.

Password must be the App Password.


Click Add Account.


--------------------------------------------------


VERIFY EMAIL ADDRESS


Gmail will send a verification email to your custom domain address.


Because Cloudflare forwards the email, you will receive it in your Gmail inbox.


Enter the verification code or click the confirmation link.


--------------------------------------------------


STEP 5 — TEST SENDING EMAIL


Open Gmail and click Compose.


In the From dropdown select your custom domain email.


Example:


contact@yourdomain.com


Send a test email.


Example:


To: another email

Subject: Test custom domain email

Message: Testing Cloudflare email routing setup.


If everything is configured correctly, the email will be sent using your custom domain.


--------------------------------------------------


EMAIL SETUP SUMMARY


Domain DNS: Cloudflare

Incoming Mail: Cloudflare Email Routing

Mailbox: Gmail

Outgoing Mail: Gmail SMTP


--------------------------------------------------


ADVANTAGES OF THIS SETUP


- Free custom domain email

- No Google Workspace required

- Use Gmail interface

- Easy DNS management with Cloudflare


--------------------------------------------------


REFERENCES


Cloudflare Email Routing

https://developers.cloudflare.com/email-routing/


Gmail SMTP documentation

https://support.google.com/mail/answer/22370


Google App Passwords

https://support.google.com/accounts/answer/185833


--------------------------------------------------