Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save unitycoder/5e521b2db4eb329ad4cd6f13b4b426cb to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/5e521b2db4eb329ad4cd6f13b4b426cb to your computer and use it in GitHub Desktop.
Get a custom email address for FREE using Cloudflare + Gmail

// https://x.com/tokifyi/status/2025741929997361371

Get a custom email address for FREE using Cloudflare + Gmail Did you know you can just use Cloudflare email routing to get a custom email for free? Most people pay $6-12/month for Google Workspace or Microsoft 365 just to get a custom email. This setup costs you nothing except the domain itself. Here's what you need:

A domain name ($10-15/year from Namecheap, GoDaddy, etc. - students: free via GitHub Student Pack)
A Gmail account (free)
Cloudflare account (free)

Step 1: Get a Domain

  • Buy one from Namecheap, Porkbun, or any registrar
  • Cheapest options: .xyz, .site, .online (~$2-5/year)
  • Premium options: .com, .io, .ai (~$10-15/year)
  • Students: Get free domains from GitHub Student Pack: https://education.github.com/pack
  • Pick something short and memorable for your brand Step 2: Add Your Domain to Cloudflare
  • Sign up at cloudflare.com (free plan works perfectly)
  • Click "Add a site" and enter your domain
  • Cloudflare will scan your DNS records
  • Copy the two nameservers Cloudflare gives you
  • Go back to your domain registrar and update the nameservers
  • Wait about 5-10 minutes for DNS to propagate globally Step 3: Enable Email Routing
  • In Cloudflare dashboard, go to Email → Email Routing
  • Click "Get Started" to enable the feature
  • Enter your Gmail address as the destination email
  • Check your Gmail for a confirmation link from Cloudflare
  • Click it to verify you own that inbox
  • You're now ready to create custom addresses Step 4: Create Custom Email Addresses
  • Click "Create address" in the Email Routing section
  • Type the address you want: hello@, contact@, support@, sales@, hi@
  • Choose where it forwards to (your Gmail)
  • Click Save
  • Repeat for unlimited addresses - they're all free
  • Each one can go to the same Gmail or different inboxes Step 5: Send FROM Your Custom Email (Optional)
  • Open Gmail and go to Settings → See all settings
  • Click the "Accounts and Import" tab
  • Under "Send mail as", click "Add another email address"
  • Enter your name and custom email (hello@yourdomain.com)
  • When it asks for SMTP password: DON'T use your regular Gmail password
  • Go to Google Account → Security → 2-Step Verification (enable it first)
  • Scroll to "App passwords" → Generate one for "Mail"
  • Use that app password in the SMTP setup
  • Verify via confirmation email
  • Now you can send from your custom address in Gmail Step 6: Set Up SPF to Avoid Spam (Recommended)
  • Go back to Cloudflare → DNS → Records
  • Add a TXT record:
  • Name: @ (or your domain)
  • Content: v=spf1 include:_spf.google.com ~all
  • This tells email servers Gmail is authorized to send from your domain
  • Helps A LOT with deliverability Note on DKIM: Regular Gmail doesn't support DKIM signing for custom domains - only Google Workspace does. So some emails might still hit spam without it. For personal use, SPF alone is usually fine though. The Result: You receive emails at hello@yourdomain.com in your normal Gmail inbox. You can reply from that address. You look professional. You pay $0/month for email (just the annual domain cost). No storage limits because it's using your free Gmail storage. Important Limitations:
  • Cloudflare only forwards emails - it doesn't store them or provide a mailbox
  • When sending via Gmail's "Send mail as", emails might go to spam initially (needs SPF/DKIM setup)
  • Gmail limits: 500 emails sent per day from custom addresses
  • Not ideal for high-volume business email or teams (stick with Google Workspace for that) Perfect for: freelancers, side projects, personal brands, small businesses, portfolio sites Not ideal for: large teams, high-volume sales email, enterprises That's it. Professional custom email for ~$10/year instead of $72+/year with Google Workspace. Note: It's not sponsored by Cloudflare. I just happened to know this method and wanted to share it. If you know any other free/cheap alternatives or hacks like this, let me know. Feel free to follow me for more little tips like this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment