Skip to content

Instantly share code, notes, and snippets.

@wenboown
Last active January 9, 2026 17:42
Show Gist options
  • Select an option

  • Save wenboown/b8d5467152afb5a4e34d40d83dda541c to your computer and use it in GitHub Desktop.

Select an option

Save wenboown/b8d5467152afb5a4e34d40d83dda541c to your computer and use it in GitHub Desktop.
Gmail Alias Setup: Reply as Custom Domain Email

Option 1: Gmail Alias Simple Setup: Reply as Custom Domain Email

Complete guide to forward emails from abc@myfirm.com to Gmail and reply as the alias.

Part 1: Namecheap DNS Email Forwarding

ref: https://www.namecheap.com/support/knowledgebase/article.aspx/308/2214/how-to-set-up-free-email-forwarding/

  1. Log into Namecheap → Domain List → Select your domain
  2. Go to Advanced DNS tab
  3. Find the Mail Settings section and select Email Forwarding
  4. Go to Domain tab,scroll down to Redirect Email. Click Add Forwarder
  5. Set:
    • Host: abc (or @ for root domain)
    • Forward to: my@gmail.com
    • TTL: Automatic
  6. Click Save

Note: DNS propagation can take 15 minutes to 48 hours.

Part 2: Gmail "Send Mail As" Configuration

  1. Open Gmail → Settings (⚙️) → See all settings
  2. Go to Accounts and Import tab
  3. In Send mail as section, click Add another email address
  4. Enter:
    • Name: Your display name
    • Email address: abc@myfirm.com
    • Check Treat as an alias (if available)
    • Click Next Step
  5. Configure SMTP:
    • SMTP Server: smtp.gmail.com
    • Port: 587 (or 465 for SSL)
    • Username: Your full Gmail address (my@gmail.com)
    • Password: Your App Password (try https://myaccount.google.com/apppasswords, if doesn't work, go to your google account management page, not your gmail setting, search App Password in the top search bar. You need to enable 2FA for this to work.)
    • Secured connection: TLS (or SSL for port 465)
    • Click Add Account
  6. Verify: Check your inbox for verification email from Gmail, click the link
  7. Set Default (optional): In "Send mail as", click Make default next to abc@myfirm.com

Part 3: Optional - SPF/DKIM for Better Deliverability

SPF Record (Recommended)

  1. In Namecheap Advanced DNS, add TXT Record:
  • Host: @
  • Value: v=spf1 include:_spf.google.com ~all
  • TTL: Automatic

DKIM Record (Advanced)

  1. Enable in Google Workspace Admin (if using) or use Gmail's default
  2. Add TXT record with Google-provided DKIM key

Troubleshooting

  • 2FA Enabled? Use App Password instead of regular password
  • Verification email not arriving? Check spam folder, wait for DNS propagation
  • Emails marked as spam? Add SPF record (Part 3)
  • Can't send? Verify SMTP settings, check firewall/antivirus blocking port 587

Usage

After setup, when composing emails:

  • Click From dropdown to select abc@myfirm.com
  • Or set it as default to always send from alias

Option 2: Namecheap + Cloudflare + Resend

Goal: Forward abc@myfirm.com to Gmail, reply as that alias, and keep Resend working for your website.

Part 1: Cloudflare Email Routing (Receiving)

This replaces the Namecheap "Redirect Email" tab.

  1. Prerequest: Create a free Cloudflare account and follow their steps to change your Nameservers in Namecheap.
  2. Log into Cloudflare → Select your domain.
  3. Go to Email (sidebar) → Email Routing.
  4. Destination addresses: Add your my@gmail.com and verify it via the email Google sends you.
  5. Routing rules:
  • Click Create rule.
  • Custom address: abc (so it handles abc@myfirm.com).
  • Action: Send to my@gmail.com.
  1. DNS Records: Cloudflare will prompt you to "Add records automatically" to enable routing. Accept this. It will add 3 MX records and an SPF record to your DNS.

Part 2: Resend & Custom DNS Configuration

This ensures your website form and Resend verification stay active.

In your Cloudflare DNS > Records tab, ensure you have the following records (Cloudflare's Routing records will already be there):

Type Name (Host) Content (Value) TTL / Proxy
MX send feedback-smtp.us-east-1.amazonses.com Auto / DNS Only
TXT send v=spf1 include:amazonses.com ~all Auto / DNS Only
TXT resend._domainkey p=MIGfM... (from Resend) Auto / DNS Only
TXT _dmarc v=DMARC1; p=none; Auto / DNS Only

Tip

Important for SPF: Cloudflare's Email Routing automatically creates a TXT record for @. Edit that record to include Google so you can "Send Mail As":

  • **Find TXT Record for @**
  • Change it to: v=spf1 include:_spf.google.com include:_spf.mx.cloudflare.net ~all

Part 3: Gmail "Send Mail As" (Replying)

Even though Cloudflare handles incoming mail, Gmail's servers handle the outgoing "Reply."

  1. Open Gmail → Settings (⚙️) → See all settingsAccounts and Import.
  2. In Send mail as, click Add another email address.
  3. Email address: abc@myfirm.com | Treat as an alias: Checked.
  4. SMTP Configuration:
  • SMTP Server: smtp.gmail.com
  • Port: 587
  • Username: Your Gmail (my@gmail.com)
  • Password: Your Google App Password (Search "App Passwords" in your Google Account settings; 2FA must be on).
  1. Verify: Click the link in the confirmation email sent to your inbox.

Troubleshooting & FAQ

  • Why use @ for one and send for the other? Using the send subdomain for Resend keeps your website's automated traffic separate from your personal "Reply" reputation. It prevents one from getting the other marked as spam.
  • Conflict Errors? Cloudflare is smart—it will warn you if you have two MX records for the exact same name. As long as your forwarding is on @ and Resend is on send, you are safe.
  • DMARC: The p=none policy is a "monitoring" mode. It is the safest way to start to ensure your emails don't get blocked while you test the new setup.

Option 3 Setup: Google Workspace + Resend on Namecheap DNS

Goal: Professional email via Google Workspace (you@firm.com) and website forms via Resend (website@send.firm.com).

Part 1: Main Domain Records (Google Workspace)

These should already be in your Namecheap Advanced DNS tab.

  1. MX Records:
  • Host: @ | Value: ASPMX.L.GOOGLE.COM (Priority 1)
  • Note: You may have 4 other Google alt-servers listed; keep them.
  1. SPF Record (TXT):
  • Host: @
  • Value: v=spf1 include:_spf.google.com ~all
  1. DKIM and DMARC settings:
  • Host: _dmarc

  • Value: v=DMARC1; p=none; rua=mailto:admin@yourdomain.com

  • Host: google._domainkey

  • Value: v=DKIM1; k=rsa; p=[value given by google]

Part 2: Subdomain Records (Resend)

Add these alongside your Google records to handle the website forms.

Type Host Value TTL
MX send feedback-smtp.us-east-1.amazonses.com Automatic (10)
TXT send v=spf1 include:amazonses.com ~all Automatic
TXT resend._domainkey [Paste unique key from Resend] Automatic

Part 3: Essential Security (DMARC)

Google and Yahoo now require a DMARC record for all domains sending to their users.

  1. In Namecheap Advanced DNS, click Add New Record.
  2. Type: TXT Record
  3. Host: _dmarc
  4. Value: v=DMARC1; p=none;
  • Note: p=none is the "safe" setting that won't block your mail if you made a typo.

Why this works

  • No Conflicts: Because Resend is isolated to the send host, it never touches the traffic meant for your Google Inbox (@ host).
  • Reputation Protection: If your website's contact form ever gets spammed, your main business email reputation is protected because they use different "sending identities."
  • Workspace Native: Since you are paying for Workspace, you don't need "App Passwords" or aliases in your Gmail settings; everything just works natively.

Troubleshooting

  • Resend won't verify? Double-check that the "Host" in Namecheap is just send and not send.yourdomain.com. Namecheap appends the domain automatically.
  • Google Workspace "SPF error"? Ensure you only have one TXT record with the host @ that starts with v=spf1. If you have two, merge them into: v=spf1 include:_spf.google.com include:amazonses.com ~all

Would you like me to show you how to set up "Custom Settings" in Resend so your website emails show your company logo in the recipient's inbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment