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.
The Problem: Custom Email is Expensive
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 Solution: Free Stack
The combination I landed on costs $0/month and handles both inbound and outbound email reliably:
- Cloudflare Email Routing — Free inbound email routing — forwards anything sent to your domain to any Gmail or personal address
- SMTP2Go — Free tier allows 1,000 emails/month for sending via SMTP relay
You keep your existing Gmail inbox and just layer custom domain addressing on top. No new apps to learn, no new inbox to check.
Part 1: Setting Up Cloudflare Email Routing
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.
Step 1: Enable Email Routing in Cloudflare
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.
Step 2: Verify MX Records
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.Step 3: Add Routing Rules
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.
Optional: Set Up a Catch-All
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.
Part 2: Setting Up SMTP2Go for Outbound Email
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.
Step 1: Create an SMTP2Go Account
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.
Step 2: Add and Verify Your Domain
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: STARTTLSStep 3: Get Your SMTP Credentials
Go 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.
Part 3: Configuring Gmail to Send As Your Domain
Now comes the magic — configure Gmail to send emails that appear to come from your custom domain:
- In Gmail, open Settings (gear icon) > See all settings
- Go to the 'Accounts and Import' tab
- Under 'Send mail as', click 'Add another email address'
- Enter your name and custom email address (e.g., hello@yourdomain.com), uncheck 'Treat as an alias', then click Next
- Fill in SMTP server: mail.smtp2go.com, Port: 587, your SMTP2Go username and password, select TLS. Click 'Add Account' and verify via the confirmation email.
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.
DNS Records: SPF, DKIM, and DMARC
These three DNS records are critical for email deliverability. Without them, your emails may land in spam or be rejected entirely.
SPF Record
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 Record
DKIM (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 Record
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.
Common Gotchas
Things I ran into during setup that aren't obvious from the documentation:
- DNS propagation takes time — after adding or changing DNS records, wait up to 24 hours before testing. Most propagation completes in 30 minutes, but sometimes it takes longer.
- Gmail's 'Send mail as' verification email sometimes lands in spam. Check your spam folder if you don't see it within a few minutes.
- SMTP2Go free tier has a daily limit in addition to the monthly limit. If you're sending a lot at once, spread it out or upgrade.
- If your emails still land in spam after setting up all three DNS records (SPF, DKIM, DMARC), check your email content — spammy words, too many links, or HTML-only emails without a plain text version are common culprits.
Glossary
- SPF (Sender Policy Framework)
- A DNS TXT record that specifies which mail servers are authorized to send email on behalf of your domain. Prevents spammers from forging your domain as the sender.
- DKIM (DomainKeys Identified Mail)
- A method that adds a digital signature to outgoing email headers. The receiving server checks the signature against a public key in your DNS to verify the email wasn't tampered with in transit.
- DMARC (Domain-based Message Authentication)
- Builds on SPF and DKIM by letting domain owners publish a policy for what to do with emails that fail authentication. Also enables reporting so you can see who's sending email that claims to be from your domain.
- MX Record
- DNS records that specify which mail servers are responsible for accepting email messages on behalf of your domain. The number (priority) determines which server is tried first.
- SMTP Relay
- A service that accepts your outgoing email and delivers it on your behalf using their servers and IP reputation. Avoids the need to manage your own mail server infrastructure.
Conclusion
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

