If your WordPress emails land in spam or never arrive, the usual fix is setting up SMTP and adding three DNS records: SPF, DKIM, and DMARC. This guide walks you through each step, from choosing an SMTP plugin to verifying your authentication records. You’ll need access to your domain’s DNS settings (usually at your registrar or hosting provider) and, if you use a third-party email service, its API keys or SMTP credentials.
What You'll Need
- WordPress admin access
- Access to your domain’s DNS management panel (e.g., Cloudflare, GoDaddy, Namecheap, your host)
- SMTP credentials from your email service (e.g., SendGrid, Mailgun, Amazon SES, or your hosting provider’s SMTP server)
- A way to generate a DKIM key (most email services provide one; otherwise you can generate via online tools or your DNS provider)
Step-by-Step
- Install an SMTP plugin. Popular options include WP Mail SMTP, Easy WP SMTP, or Post SMTP. Go to Plugins → Add New, search for one, install and activate.
- Configure the plugin with your SMTP server. In the plugin settings, enter the SMTP host (e.g., smtp.sendgrid.net), port (usually 587 for TLS or 465 for SSL), and your username/password. If you use a service like SendGrid or Mailgun, use the API key as the password.
- Set the “From” email address. Use an address on your own domain (e.g., no-reply@yourdomain.com). Many plugins have a “Force From Email” option—enable it to prevent other plugins from overriding it.
- Send a test email. Use the plugin’s test email feature. Check that it arrives in your inbox, not spam. If it fails, double-check the SMTP host and port.
- Add an SPF record. In your DNS panel, create a TXT record with the value:
v=spf1 include:spf.your-email-service.com ~all. Replace the include with the one provided by your email service (e.g., for SendGrid:include:sendgrid.net). If you use your hosting’s SMTP, include their SPF value. If you have multiple senders, list them all in one SPF record. - Add a DKIM record. Your email service will give you a DKIM selector and a public key. In DNS, create a TXT record with the name like
default._domainkey(or the selector they provide) and the valuek=rsa; p=YOUR_PUBLIC_KEY. If you’re not using a third-party service, you’ll need to generate a key pair (many hosting panels have a DKIM generator). - Add a DMARC record. Create a TXT record with the name
_dmarcand the value:v=DMARC1; p=none; rua=mailto:you@yourdomain.com. Start withp=noneto monitor, then later change top=quarantineorp=rejectonce you confirm emails are authenticating. - Wait for DNS propagation. DNS changes can take up to 48 hours, but often less. You can check with online tools like MXToolbox or Google Admin Toolbox.
- Verify your records. Use the same tools to check SPF, DKIM, and DMARC. They should show “pass” or “valid”.
- Monitor DMARC reports. If you set
ruain your DMARC record, you’ll receive aggregate reports. Review them to see if any legitimate senders are failing authentication, then adjust if needed.
Common Mistakes
- Using a free email address as the From address. Always use your own domain.
- Having multiple SPF records. SPF allows only one record; if you have more than one, combine them into a single record with multiple
includestatements. - Forgetting to include all sending services. If you send via both your hosting and a third-party service, both must be in SPF and DKIM.
- Setting DMARC to
p=rejecttoo early. Start withp=noneto avoid legitimate emails being rejected while you’re still configuring. - Using the wrong DKIM selector. The selector must match exactly what your email service expects.
- Ignoring the “From” name. Some email clients display the name; make sure it’s recognizable.
Tips
- Use a dedicated SMTP service (like SendGrid, Mailgun, or Amazon SES) for better deliverability than your hosting’s shared SMTP.
- Keep your email list clean—remove invalid addresses and unsubscribes to reduce bounces.
- Add a plain-text version of your emails; some email clients flag HTML-only emails as spam.
- Monitor your sender reputation using tools like Google Postmaster Tools (if you send to Gmail users).
- Test your emails with a tool like Mail-Tester.com to see specific issues before sending to your whole list.
Troubleshooting
If emails still go to spam or fail after setup, check the following:
- SPF fails: Check that your SPF record doesn’t have too many DNS lookups (limit is 10). Use a tool to count lookups.
- DKIM fails: Verify the selector and key are correct. Sometimes the key is truncated—copy the entire value.
- DMARC fails: Ensure your DMARC record is exactly
v=DMARC1; p=none; rua=mailto:...with semicolons in place. - Emails not sending at all: Check your SMTP plugin’s error logs. Common issues: incorrect port, blocked port (try 587), or wrong credentials.
- Emails sending but landing in spam: Check your email content—too many links, images, or spammy words can trigger filters. Also, make sure your From name and email are consistent.
- DNS not propagating: Wait 24-48 hours. Use a global DNS checker to see if the record is visible worldwide.
Frequently Asked Questions
Do I need all three records?
Yes, ideally. SPF and DKIM authenticate your sender, while DMARC tells receiving servers what to do if those checks fail. Without DMARC, some servers may still reject emails even if SPF/DKIM pass.
Can I use the same SPF record for multiple domains?
No, each domain needs its own SPF record. If you send from subdomains, you can set SPF on the subdomain separately.
What if my hosting provider already has an SPF record?
You can edit that record to add your email service’s include. Just don’t create a second SPF record—edit the existing one.
How long does DNS propagation take?
Usually a few hours, but it can take up to 48 hours. You can check with a DNS lookup tool to see if it’s live.
Will these settings affect my existing email accounts?
If you add SPF/DKIM/DMARC records, they apply to your domain’s email sending. They should not affect receiving email, but they may cause emails from your domain to be rejected if they fail authentication—so start with DMARC p=none.
I use a plugin like Contact Form 7. Will this help?
Yes, any email sent from WordPress (including contact form notifications) will use the SMTP settings you configure, so it will benefit from the authentication records.