A recipe for setting up your email address at your custom domain for free. Using Gmail, Cloudflare, Mailgun and optionally Mailchimp.

Mailgun

Create an account then verify it. You need to add a credit card to get all of the features, but it’s still free for the first 10,000 emails a month.

Add domain

Go to Domains:

  1. Click “Add Domain” button
  2. Under “Domain Name” enter your domain (ex: example.com) Ignore the message “We highly recommend using a subdomain”. You should not include a subdomain if you want to receive email too.
  3. Submit the form

Forward email to Gmail

Go to Routes:

  1. Click “Create Route” button
  2. Set “Expression Type” to “Match Recipient”
  3. Set “Recipient” to your email address (ex: [email protected])
  4. Under “Actions” check “Forward” and add your Gmail address (ex: [email protected])
  5. Submit the form

Cloudflare

Get config from Mailgun

In Mailgun go to your domain (ex: https://app.mailgun.com/app/domains/example.com). Keep this page open as you will be copying and pasting values from here to Cloudflare.

Configure DNS

In Cloudflare go to the DNS section.

  1. Add the 2 TXT records using their supplied values. (ex: v=spf1 include:mailgun.org ~all and k=rsa)
  2. Add a CNAME record with “email” as the “Name” and mailgun.org as the “Value”.
  3. Uncheck the cloud icon for the CNAME.
  4. Add an MX record with your domain as the “Name” and “mxa.mailgun.org” as the “Value” and a “Priority” of “10”.
  5. Add an MX record with your domain as the “Name” and “mxb.mailgun.org” as the “Value” and a “Priority” of “10”.

In Mailgun click the “Check DNS Records Now” button to confirm settings are correct.

Gmail

Go to Gmail:

  1. Click the “Cog” icon and go to Settings
  2. Click the “Accounts and Import” tab.
  3. Under “Send mail as” click “Add another email address”:
    • Set “Name” to your personal or company name
    • Set “Email address” to your email address (ex: [email protected])
    • Ensure “Treat as an alias” is checked
  4. Click “Next Step” button
  5. Fill in the form with settings from you domains “Domain Information” at Mailgun.
    • Gmail’s “SMTP Server” equals Mailgun’s “SMTP Hostname”
    • Gmail’s “Username” equals Mailgun’s “Default SMTP Login”
    • Gmail’s “Password” equals Mailgun’s “Default Password”
    • Ensure “Secured connection using TLS” is checked
  6. Click “Add Account” button
  7. You should receive a message like: “Congratulations, we successfully located your other server and verified your credentials.”
  8. Verify your new email address in Gmail

Mailchimp (optional)

In Mailchimp add your domain at Account -> Domains:

  1. Click “Verify A Domain”
  2. Under “Email Address” enter you email address
  3. Go to Gmail and click the verification link

In Cloudflare add these records:

  1. Add a CNAME record with k1._domainkey.example.com for “Name” and dkim.mcsv.net for “Value”.
  2. Add a TXT record with example.com for “Name” and v=spf1 include:servers.mcsv.net ?all for “Value”.

In Mailchimp at Account -> Domains:

  1. Click “Authenticate” button to the right of your domain.