A complete guide to sending emails from a custom domain alias in Gmail using proper SPF and DMARC setup.
Using a Gmail alias with a custom domain (e.g., xxx@gading.dev
) allows you to send professional-looking emails through Gmail while maintaining your brand identity. However, without proper SPF and DMARC configuration, your emails might get rejected or flagged as spoofed by recipient servers such as Gmail or Outlook.
This guide walks you through how to set up a Gmail alias, generate an App Password, configure DNS records for SPF and DMARC, and test everything to ensure reliable email delivery.
Requirement | Description |
---|---|
A Gmail Account | A personal Google account (not Google Workspace). |
A custom domain & DNS access | e.g., gading.dev , with access to manage its DNS settings. |
Email forwarding set up | e.g., xxx@gading.dev → youraccount@gmail.com , and verified working. |
2-Step Verification enabled | Required to generate a Gmail App Password. |
Open Gmail → ⚙ → See all settings → Accounts and Import tab.
Under Send mail as, click Add another email address.
Enter the following:
xxx@gading.dev
On the SMTP configuration screen, enter:
Field | Value |
---|---|
SMTP Server | smtp.gmail.com |
Port | 587 (TLS) |
Username | Your primary Gmail address (youraccount@gmail.com ) |
Password | The 16-digit App Password you just created |
Connection | TLS (recommended) |
Click Add Account. Gmail will send a verification code to your alias. Since forwarding is enabled, the code will arrive in your Gmail inbox. Enter the code to complete verification.
To allow Gmail to send emails on behalf of your domain, and to pass authentication checks (especially DMARC), you need to set up SPF and DMARC records in your domain’s DNS settings. This can be done via your domain registrar or DNS provider (e.g., Cloudflare, Namecheap, GoDaddy, etc).
Go to your domain’s DNS management page.
Add a new TXT record:
@
v=spf1 include:_spf.google.com ~all
Save the record.
⚠️ Note: Only one SPF record is allowed per domain. If one already exists, merge the values instead of creating a new one.
Add another TXT record:
_dmarc
v=DMARC1; p=none; rua=mailto:postmaster@gading.dev; aspf=r; adkim=r
Save the record.
p=none
instructs mail servers to only monitor failed authentication, without rejecting messages. Once you verify proper setup, you may change it toquarantine
orreject
.
Wait 15–30 minutes for DNS propagation.
In Gmail, compose a new message and select xxx@gading.dev
as the From address.
Send the message to a different email provider (e.g., another Gmail or Outlook account).
Open the received email, click More → Show original, and verify:
PASS
PASS
(signed by gmail.com)PASS
or aligned with p=none
Use tools like MXToolbox, Google Admin Toolbox, or Mail-tester.com for deeper validation and header analysis.
Option | Benefit |
---|---|
Set DMARC to quarantine or reject | Prevent spoofed emails from passing validation. |
Use a third-party SMTP provider | e.g., SendGrid, Brevo – ensures full DKIM alignment with your domain. |
Use Google Postmaster Tools | Monitor domain reputation and DMARC reports over time. |
By correctly adding a Gmail alias, generating an App Password, and setting SPF and DMARC records in your domain’s DNS, you can send emails as xxx@gading.dev
directly from Gmail—securely and reliably. Always monitor your email deliverability and update your policies accordingly.
Happy emailing!