Developers and businesses setting up custom email addresses (e.g. contact@yourdomain.com) whose emails are landing in Gmail spam folders.
- ✓A registered domain name with access to DNS records
- ✓Free Zoho Mail or Google Workspace account
🚀 What You Will Learn & Build
- ▸Configuring MX records to route incoming emails
- ▸What SPF is and how to create the correct TXT record
- ▸Generating and publishing DKIM cryptographic keys
- ▸Setting up a DMARC policy for email authentication
1. Why Your Emails Land in the Spam Folder
2. Setting up the SPF (Sender Policy Framework) Record
# For Zoho Mail users:
Type: TXT
Host / Name: @
Value: v=spf1 include:zoho.com ~all
# For Google Workspace (Gmail):
Type: TXT
Host / Name: @
Value: v=spf1 include:_spf.google.com ~all
# For shared cPanel server:
Type: TXT
Host / Name: @
Value: v=spf1 +a +mx ~all3. Configuring DKIM (DomainKeys Identified Mail)
# Example DKIM for Zoho:
Type: TXT
Host / Name: zoho._domainkey
Value: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ...[publicKey]...DAQAB4. Setting up DMARC (Domain-based Message Authentication)
Type: TXT
Host / Name: _dmarc
Value: v=DMARC1; p=none; rua=mailto:admin@yourdomain.com; pct=100; sp=none✨ Expected Output & Verification
Sending a test email to mail-tester.com scores 10/10 with SPF, DKIM, and DMARC passing with zero warnings.
🧪 How to Test the Implementation
- 1Send a test message to https://www.mail-tester.com
- 2Check headers in received Gmail: Click three dots → 'Show Original' and verify SPF, DKIM, DMARC all show 'PASS'
⚠️ Common Errors & How to Fix Them
Root Cause: Publishing two separate TXT records containing v=spf1.
Fix: Combine them into one: 'v=spf1 include:zoho.com include:_spf.google.com ~all'. A domain can only have ONE SPF record.
🛡️ Security Considerations & Best Practices
- !Never publish private DKIM keys in public repositories or client files.
❓ Frequently Asked Questions (FAQ)
Yes, Zoho Mail offers a Forever Free plan supporting up to 5 users on your custom domain with 5GB storage per user.
📌 Summary of Key Takeaways
- ✓MX handles inbound email; SPF and DKIM authenticate outbound email.
- ✓Never create more than one SPF TXT record per domain.
Official References & Further Reading
- 🔗Google Workspace Email Deliverability Standards— Official deliverability guidelines for bulk and transactional email.
Written by Manoj Neupane
AuthorSoftware developer and programming instructor, Nepal
Building software systems and SaaS platforms with Laravel, Next.js, and Node.js. Passionate about helping students and developers in Nepal master practical, real-world development skills.