Free Custom Email: Cloudflare Routing + SMTP2Go

Photo by Unsplash

Photo by Unsplash
Having a custom domain email like hello@yourdomain.com looks professional, but most solutions cost money. Google Workspace starts at $6/user/month, Microsoft 365 is similar, and self-hosted mail servers are notoriously complex to maintain. After years of using personal Gmail for my projects, I finally found a fully free setup that works reliably: Cloudflare Email Routing for receiving mail and SMTP2Go for sending.
When I launched my personal domain, the first thing I wanted was a professional email address. The obvious choice is Google Workspace, but $6/month per user adds up quickly, especially for a solo developer or a small project that doesn't generate revenue yet.
Self-hosting an SMTP server is free but comes with its own nightmares: IP reputation management, spam filtering, DKIM/DMARC configuration, and the constant risk of your IP ending up on a blacklist. There had to be a better way.
The combination I landed on costs $0/month and handles both inbound and outbound email reliably:
You keep your existing Gmail inbox and just layer custom domain addressing on top. No new apps to learn, no new inbox to check.
Cloudflare Email Routing is a free service that sits on top of your DNS. When someone emails you@yourdomain.com, Cloudflare intercepts it and forwards it to your personal Gmail. Setup takes about 10 minutes.
Log in to the Cloudflare dashboard, select your domain, then navigate to Email > Email Routing. Click 'Get started' and Cloudflare will walk you through enabling the feature. It will automatically add the required MX records to your DNS.
Cloudflare adds three MX records pointing to its routing servers. You can verify these were added correctly in your DNS settings:
Cloudflare's MX records (added automatically):
; Cloudflare Email Routing MX Records
; These are added automatically when you enable Email Routing
yourdomain.com. MX 10 route1.mx.cloudflare.net.
yourdomain.com. MX 20 route2.mx.cloudflare.net.
yourdomain.com. MX 30 route3.mx.cloudflare.net.In the Email Routing section, go to 'Routing rules' and click 'Create address'. Add your custom address (e.g., hello@yourdomain.com) and the destination Gmail where it should forward. Cloudflare will send a verification email to the destination — click the link to confirm.
Under 'Routing rules', you can enable a catch-all address. This means any email to ANY address at your domain (including typos or addresses you haven't created yet) gets forwarded to your Gmail. Useful for catching emails to old addresses or testing.
Cloudflare Email Routing only handles inbound mail — it cannot send. For outbound, we use SMTP2Go's free tier, which allows 1,000 emails/month. This is more than enough for personal use and most small projects.
Go to smtp2go.com and sign up for a free account. The free tier gives you 1,000 emails/month with no credit card required.
In the SMTP2Go dashboard, go to Sending > Sender Domains and add your domain. SMTP2Go will ask you to add DNS records (SPF, DKIM) to your Cloudflare DNS. Copy each record and add them in your Cloudflare DNS settings. Use the SMTP settings below when configuring Gmail:
; SMTP2Go Configuration
SMTP Host: mail.smtp2go.com
SMTP Port: 587 (TLS/STARTTLS — recommended)
SMTP Port: 465 (SSL — alternative)
Username: your_smtp2go_username
Password: your_smtp2go_api_key_or_password
Encryption: STARTTLSGo to Settings > SMTP Users in your SMTP2Go dashboard. Create a new SMTP user — you'll get a username and password to use when configuring Gmail. Keep these credentials safe.
Now comes the magic — configure Gmail to send emails that appear to come from your custom domain:
Test your email deliverability score at mail-tester.com — send an email to the address they provide and get a score out of 10. A score of 9+ means you have excellent deliverability. Use this to verify all your DNS records are correct before sending to real recipients.
These three DNS records are critical for email deliverability. Without them, your emails may land in spam or be rejected entirely.
SPF (Sender Policy Framework) tells receiving mail servers which servers are allowed to send email for your domain. Since we're using SMTP2Go to send, we need to authorize their servers:
; SPF TXT Record — allows SMTP2Go to send on your behalf
; Type: TXT Name: @ TTL: Auto
v=spf1 include:spf.smtp2go.com ~allDKIM (DomainKeys Identified Mail) adds a cryptographic signature to your outgoing emails. SMTP2Go generates this key pair for you — the private key signs outgoing mail, and the public key (below) goes in your DNS so recipients can verify the signature:
; DKIM TXT Record — provided by SMTP2Go dashboard
; Type: TXT Name: smtpgo._domainkey TTL: Auto
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GN...
; (replace with the actual key from SMTP2Go)DMARC (Domain-based Message Authentication, Reporting and Conformance) ties SPF and DKIM together and tells receiving servers what to do when they fail. Start with p=none to monitor without taking action, then move to p=quarantine or p=reject once you're confident everything is working:
; DMARC TXT Record — start with p=none to monitor before enforcing
; Type: TXT Name: _dmarc TTL: Auto
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.comYou can only have ONE SPF record per domain (one TXT record starting with 'v=spf1'). If you already have an SPF record (e.g., from a previous email service), do NOT add a second one. Instead, merge the include statements into a single record. Having duplicate SPF records causes authentication failures and can break your email entirely.
Things I ran into during setup that aren't obvious from the documentation:
This setup has been running for months without issues. Inbound mail arrives in my Gmail instantly, and outbound mail from my custom domain has a 10/10 mail-tester.com score. The entire setup is free, requires no maintenance, and took less than an hour. If you're a developer or freelancer who wants a professional email without the monthly cost, this combination is hard to beat.
Related Articles