Email Deliverability

Why Are My Emails Going to Spam? How to Fix SPF, DKIM & DMARC

H
HTMLtoPHP TeamMay 17, 2026 โ€ข 8 min read

You send an important proposal to a client or a password reset link to a new user, and days later you find out they never saw it. Your email landed directly in their Spam or Junk folderโ€”or worse, was rejected entirely by Gmail with a 550-5.7.26 Unauthenticated email error.

With Google, Yahoo, and Microsoft enforcing strict domain authentication rules for all email senders, simply sending an email from your server is no longer enough. To guarantee 99%+ inbox placement, you must configure the holy trinity of email authentication: SPF, DKIM, and DMARC. In this step-by-step guide, we will show you how to set up all three DNS records in under 10 minutes.

"Email spam filters no longer trust senders by default. If your domain does not have SPF, DKIM, and DMARC published in DNS, your emails are treated like forged spam."


1. Why Emails Go to Spam (The 2026 Rules)

In the past, spam filters primarily scanned email text for "trigger words" like FREE or BUY NOW. Today, 90% of spam filtering happens at the DNS network level before the recipient's mail server even reads the subject line.

When your server connects to Gmail to deliver an email, Gmail asks your domain three cryptographic verification questions:

  1. SPF Check: Is the sending server's IP address listed as an authorized sender in your domain's DNS?
  2. DKIM Check: Does the email header contain a cryptographic digital signature matching the public key published in your DNS?
  3. DMARC Check: What should we do with this email if SPF or DKIM fails (accept, quarantine to spam, or reject completely)?

2. Setting Up SPF (Sender Policy Framework)

An SPF Record is a single TXT record placed at your root apex domain (yourdomain.com). It contains a list of authorized IP addresses and third-party mail providers (like Google Workspace, SendGrid, or Mailgun):

# Type: TXT | Name: @ (or yourdomain.com)
v=spf1include:_spf.google.comip4:198.51.100.25~all

Understanding the Modifiers:

  • v=spf1: Declares the record as SPF Version 1.
  • include:_spf.google.com: Authorizes Google Workspace / Gmail servers to send for your domain.
  • ip4:198.51.100.25: Authorizes your web server's dedicated IP address.
  • ~all (SoftFail): Recommends accepting mail but marking as suspicious if SPF fails.
  • -all (HardFail): Strict rejection if the sender is not in the list.
โš ๏ธ Golden Rule:

You must NEVER have more than one SPF TXT record on your domain. Having two SPF records causes all mail providers to fail the SPF check automatically. Combine all your services into one single TXT record string.


3. Configuring DKIM (Cryptographic Signatures)

DKIM creates a pair of cryptographic keys: a private key that stays securely inside your mail server, and a public key published as a TXT record in your domain's DNS.

When you send an email, your server signs the message body and headers with the private key. When Gmail receives the email, it grabs the public key from your DNS and validates that the message was not modified in transit.

# Type: TXT | Name: google._domainkey (or default._domainkey)
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3QVRn...

You can generate your DKIM record inside your cPanel (Email Deliverability section) or inside your Google Workspace / Microsoft 365 Admin Console.


4. Creating Your DMARC TXT Record

DMARC ties SPF and DKIM together. It instructs recipient mail servers what to do if an email pretending to come from your domain fails SPF or DKIM checks, and tells them where to send daily XML delivery reports.

# Type: TXT | Name: _dmarc.yourdomain.com
v=DMARC1; p=none; rua=mailto:[email protected]; sp=none
p=none (Monitoring)

Does not block any emails. Sends daily reports to your email so you can monitor who is sending on your domain.

p=quarantine (Spam)

Sends unauthorized emails directly into the recipient's spam folder.

p=reject (Strict Block)

Completely drops and blocks any spoofed email before it reaches the recipient's inbox.


5. Checking Reverse DNS (PTR Records)

If you are sending transactional emails directly from your VPS (DigitalOcean, Linode, AWS EC2), your server's public IP address must have a matching Reverse DNS (PTR) record that resolves back to your hostname (e.g. mail.yourdomain.com). If PTR is missing, major mail servers will reject your connection immediately.


Frequently Asked Questions

How long does it take for email deliverability to improve?
Once your SPF, DKIM, and DMARC TXT records propagate across global DNS (usually within 2-4 hours), recipient mail servers like Gmail and Yahoo will immediately recognize your domain as verified, and your spam placement rate will drop drastically.
Can I send cold outreach emails with a new domain?
Never blast high volumes of emails from a brand new domain. New domains have zero sender reputation. You must warm up the domain by sending 10-20 emails per day gradually over 3 to 4 weeks before increasing volume.

Conclusion

Implementing SPF, DKIM, and DMARC protects your brand from impersonation while guaranteeing that your critical client emails land directly in the primary inbox.

Audit your server network and domain records.

Verify your server IP, test response headers, and generate secure keys for free.

Explore Network Utilities โ†’

More Guides (20)

View All โ†’
โœ‰๏ธ
Email & Productivity

How to Set Up Custom Domain Email in Outlook, Gmail & iPhone

8 min read
โ˜๏ธ
Networking & DNS

How to Set Up Cloudflare Free CDN & DNS: Speed, SSL & Protection

8 min read
๐Ÿ“ฌ
Security & AuthenticationReading

Why Are My Emails Going to Spam? How to Fix SPF, DKIM & DMARC

8 min read
๐Ÿ”“
Security & Authentication

How to Fix "Not Secure" Warning & SSL Mixed Content Errors

7 min read
๐Ÿš€
Networking & DNS

How to Connect a Custom Domain to GitHub Pages, Vercel & Netlify

8 min read
๐ŸŒ
Networking & DNS

The Ultimate Guide to DNS Records: A, AAAA, CNAME, MX, TXT & PTR

8 min read
๐Ÿ“ก
Networking & DNS

What Is an IP Address? Public vs. Private IPv4, IPv6 & Subnetting

7 min read
๐Ÿšฆ
Networking & DNS

HTTP Status Codes Explained: 200, 301, 404, 500 & 502 Bad Gateway

7 min read
๐Ÿ›ก๏ธ
Security & Authentication

JSON Web Tokens (JWT) Demystified: Header, Payload & Signatures

8 min read
โšก
Web Performance & SEO

Mastering Core Web Vitals in 2026: Optimize LCP, INP & CLS for SEO

8 min read
๐Ÿ”’
Security & Authentication

Is Your Website Actually Secure? 3 Network Checks You Must Run

6 min read
๐ŸŽจ
Developer & Data Tools

The CSS Color Nightmare: How to Manage HEX, RGB, and Gradients

6 min read
๐Ÿงน
Developer & Data Tools

Data Cleaning Guide: How to Clean JSON, CSV & Text Like a Pro

7 min read
๐Ÿ”—
Content & Social

Stop Sharing Ugly Links: The Complete Guide to Open Graph & Twitter Cards

4 min read
๐Ÿ“‰
Web Performance & SEO

Why You Must Minify HTML, CSS, and JS Before Every Deployment

4 min read
๐Ÿ–ผ๏ธ
Web Performance & SEO

Stop Using PNGs for Everything: The Developer Guide to Image Formats

5 min read
๐Ÿš€
Web Performance & SEO

5 Essential Steps to Optimize Your Website Before Launch

4 min read
๐ŸŽฏ
Web Performance & SEO

Why Your Website is Invisible on Google: The Ultimate Meta Tag Checklist

5 min read
๐Ÿ”—
Developer & Data Tools

Stop Breaking Your Links: The Developer Guide to URL Encoding and Base64

5 min read
๐Ÿ“
Content & Social

Stop Writing HTML by Hand: The Ultimate Guide to Markdown and Text Tools

5 min read
โšก

Explore 70+ Free Tools

Instant client-side developer, networking, SEO & formatting utilities.

Browse All Tools โ†’