If your emails are consistently landing in the spam folder instead of the inbox, you're not alone. This is one of the most common issues faced by website owners, businesses, and anyone running their own mail server. The good news? It's almost always fixable.
In this guide, we'll walk you through every possible cause and give you actionable, step-by-step solutions to fix emails going to spam — whether you're sending from a VPS, shared hosting, or a transactional email service.
Quick Fix Checklist
- ✅ Verify your SPF record is published and passing
- ✅ Confirm DKIM signing is active and valid
- ✅ Set up a DMARC policy (at minimum
p=none) - ✅ Check your server IP against blacklists (MXToolbox, Spamhaus)
- ✅ Ensure a valid PTR / reverse DNS record exists
- ✅ Avoid spammy content: ALL CAPS, excessive links, misleading subjects
- ✅ Use a dedicated IP for sending if possible
- ✅ Authenticate with TLS encryption on port 587
Why Are Emails Going to Spam?
Email providers like Gmail, Outlook, and Yahoo use sophisticated spam filters that evaluate dozens of signals before deciding whether to deliver your email to the inbox or the junk folder. Here are the most common reasons:
1. Missing or Broken SPF Record
SPF (Sender Policy Framework) tells receiving servers which IP addresses are authorized to send email on behalf of your domain. Without it, your emails look suspicious.
2. No DKIM Signature
DKIM (DomainKeys Identified Mail) adds a cryptographic signature to your emails, proving they haven't been tampered with in transit. Missing DKIM is a major red flag for spam filters.
3. No DMARC Policy
DMARC ties SPF and DKIM together and tells receiving servers what to do if authentication fails. Without it, you have no control over how failed checks are handled.
4. Bad Server IP Reputation
If your server's IP address has been used for spam before (common on shared hosting or cheap VPS), your emails inherit that bad reputation.
5. Missing PTR Record (Reverse DNS)
A PTR record maps your IP address back to your domain name. Many mail servers reject or spam-filter emails from IPs without proper reverse DNS.
Step-by-Step Fix
Step 1: Set Up SPF Record
Add a TXT record to your domain's DNS:
v=spf1 ip4:YOUR_SERVER_IP include:_spf.google.com ~all
Replace YOUR_SERVER_IP with your actual server IP. If you use multiple mail services, include them all.
Verify it works:
dig TXT yourdomain.com +short
Step 2: Enable DKIM Signing
If you're using Exim (common on cPanel servers), enable DKIM in WHM under Email → DKIM. For manual setup on a VPS:
# Generate DKIM keys
opendkim-genkey -s default -d yourdomain.com
# Add the public key as a TXT record:
# Host: default._domainkey.yourdomain.com
# Value: (contents of default.txt)
Test DKIM is working:
# Send a test email to [email protected]
# Or use: https://dkimvalidator.com/
Step 3: Create a DMARC Record
Add this TXT record to your DNS:
Host: _dmarc.yourdomain.com
Value: v=DMARC1; p=none; rua=mailto:[email protected]; pct=100
Start with p=none to monitor, then move to p=quarantine or p=reject once you're confident.
Step 4: Set Up PTR / Reverse DNS
Contact your hosting provider (or set it in your VPS control panel) to create a PTR record that maps your IP to your mail hostname:
# Verify PTR record
dig -x YOUR_SERVER_IP +short
# Should return: mail.yourdomain.com
Step 5: Check Blacklists
Use MXToolbox to check if your IP is blacklisted:
# Visit: https://mxtoolbox.com/blacklists.aspx
# Enter your server IP
# If listed, follow delisting instructions for each blacklist
Step 6: Test Email Headers
Send a test email to a Gmail account, then check headers:
- Open the email in Gmail
- Click the three dots → "Show original"
- Look for SPF, DKIM, and DMARC results — all should say PASS
Verify Your Fix
Use these tools to confirm everything is working:
- mail-tester.com — Send a test email and get a score out of 10
- MXToolbox — Check DNS, SPF, DKIM, DMARC, and blacklists
- Gmail header analysis — Verify authentication passes
- DKIMValidator — Test DKIM signature
A mail-tester.com score of 9/10 or higher means your configuration is solid.
Common Mistakes
- Multiple SPF records: You can only have ONE SPF TXT record per domain. Merge them.
- Using
+allin SPF: This allows anyone to send as your domain. Use~allor-all. - DKIM key mismatch: The public key in DNS must match the private key on your server.
- Sending from a shared IP: Other users' spam affects your reputation. Use a dedicated IP.
- No warm-up: Sending thousands of emails from a new IP triggers spam filters. Warm up gradually.
- HTML-only emails: Always include a plain-text version alongside HTML.
🚀 Need Help With Email Deliverability?
QIW Host can configure SPF, DKIM, DMARC, PTR and SMTP correctly on your server — so your emails land in the inbox, not the spam folder.
Get Reliable Hosting →Frequently Asked Questions
How long does it take for DNS changes to propagate?
SPF, DKIM, and DMARC records typically propagate within 1-4 hours, but can take up to 48 hours in some cases. Use dig or MXToolbox to monitor propagation.
Will fixing SPF/DKIM/DMARC immediately stop emails going to spam?
It significantly improves deliverability, but if your IP has a poor reputation, it may take days or weeks for mailbox providers to re-evaluate your sending reputation.
Can I use Gmail SMTP to avoid spam issues?
Yes, using Gmail's SMTP relay (or services like SendGrid, Mailgun) can help because they maintain good IP reputation. However, you still need proper SPF/DKIM records.
How do I check if my server IP is blacklisted?
Visit MXToolbox Blacklist Check, enter your server IP, and it will check against 80+ blacklists simultaneously.
What's the difference between SPF, DKIM, and DMARC?
SPF verifies the sending server IP is authorized. DKIM verifies the email content hasn't been altered. DMARC tells receivers what to do when SPF or DKIM fails and provides reporting.