Corporate Email: Set Up SPF Records and DKIM Signatures to Prevent Spam
Set up SPF and DKIM records for your domain so your business emails don't end up in spam: a clear guide for your business from UNEMPRENDE.
Many businesses set up email accounts with their own domain, but their quotes and invoices still end up in the spam folder in Gmail or Outlook. The reason is almost never the text of the message itself, but rather the absence or incorrect configuration of the DNS records that verify your identity as the sender.
In this guide, you'll learn how to properly configure SPF, DKIM cryptographic signatures, and a progressive DMARC policy, as well as how to authenticate the automated emails sent by your WordPress site.
In this guide:
- Why Gmail and Outlook Reject Emails Without DNS Authentication
- How SPF, DKIM, and DMARC Work Together on Your Domain
- Step-by-Step Guide to Configuring Your SPF Record Without Exceeding the Limit
- How to Publish and Activate Your DKIM Cryptographic Signature
- Gradual Implementation of DMARC to Protect Your Reputation
- WordPress Transactional Emails and Header Verification
Why Gmail and Outlook Reject Emails Without DNS Authentication
Mass-mail providers have tightened their requirements to curb identity theft and phishing. According to the Google's official guidelines for senders, any domain that sends messages to Gmail must have valid authentication via SPF or DKIM, and both protocols along with DMARC as the volume increases.
If you send messages without these records or with syntax errors, the receiving servers usually respond with rejections such as the code 5.7.26 or send your emails straight to the spam folder. If you're still in the process of migrating from free accounts, check out our comparison of why it's a good idea to separate accounts at Corporate Email vs. Personal Email.
How SPF, DKIM, and DMARC Work Together on Your Domain
None of the three protocols replaces the others; they work in sequence starting from your DNS zone—the same place where you manage web records, as explained in the article at Cloudflare on DNS Records and in our tutorial for Configure A and CNAME records.
| Protocol | DNS Type and Host | Example of a value | Critical rule |
|---|---|---|---|
SPF |
TXT in @ |
v=spf1 include:_spf.google.com ~all |
Only 1 record per domain and a maximum of 10 DNS queries |
DKIM |
TXT in selector._domainkey |
v=DKIM1; k=rsa; p=MIIBIjAN... |
Use a 2048-bit RSA key whenever the panel allows it |
DMARC |
TXT in _dmarc |
v=DMARC1; p=none; rua=mailto:dmarc@tudominio.com |
Start monitoring before rejecting messages |
Step-by-Step Guide to Configuring Your SPF Record Without Exceeding the Limit
SPF (Sender Policy Framework) publishes a list of servers authorized to send emails on behalf of your domain. To implement it correctly, follow these rules in your DNS control panel—whether it's external or part of your Domain Management at UNEMPRENDE:
- Make a list of every service that sends emails on your behalf: This includes your primary provider (Google Workspace, Microsoft 365, Zoho, or your email server), newsletter tools, and your website's transactional services.
- Combine everything into a single TXT record: publish two records that begin with
v=spf1automatically overrides the SPF check. If you use two services, combine them on the same line:v=spf1 include:_spf.google.com include:spf.provider.com ~all. - Adheres to the maximum limit of 10 DNS lookups: each
include,a,mxoredirectcounts queries, including nested ones. Exceeding ten queries results in a permanent error (permerror). - Use
~all(softfail) during the initial phase: Flag unauthorized shipments without causing sudden rejections, while verifying that no legitimate systems were excluded.
How to Publish and Activate Your DKIM Cryptographic Signature
DKIM adds a cryptographic signature to the headers of every message sent. The receiving server looks up the public key hosted on your DNS and verifies that the email actually originated from your domain and was not tampered with in transit.
- Generate the password in your email provider: Log in to your corporate email administration console and request the DKIM key from 2048 bits (Avoid 1024 bits unless your DNS provider does not support long strings.).
- Create the exact TXT record: copy the selector's host (for example,
google._domainkeyodefault._domainkey) and paste the entire value without any extra spaces or accidental line breaks. - Enable the signature in the provider: Wait until the DNS record is visible, and then click the "Start Authentication" button in your email console. Publishing the record without enabling signing does not protect your emails.
Gradual Implementation of DMARC to Protect Your Reputation
DMARC combines SPF and DKIM by verifying alignment with the domain visible in the field From and tells the receiving server what to do if a message fails validation.
- Phase 1 — Monitoring (
p=none): create a recordTXTin_dmarcwithv=DMARC1; p=none; rua=mailto:dmarc@tudominio.com. You'll receive aggregated reports to confirm that your daily email, your CRM, and your website pass authentication. - Phase 2 — Quarantine (
p=quarantine): Once you confirm that your legitimate sources support SPF and DKIM, send them to quarantine so that spoofing attempts end up in spam. - Phase 3 — Strict Rejection (
p=reject): Completely blocks spoofed emails that attempt to impersonate your company.
WordPress Transactional Emails and Header Verification
A very common issue occurs when regular email works fine, but WooCommerce contact forms or confirmation emails bounce. By default, WordPress uses the PHP function wp_mail(), which sends emails without SMTP authentication or a DKIM signature.
The ultimate solution for your Managed WordPress Hosting is to configure an authenticated SMTP plugin or a transactional API using a sender from your own domain and add that service to your SPF record and DKIM selector.
How to Check That Everything Is Set Up Correctly
Before testing the shipment, confirm from your device by dig +short TXT yourdomain.com y dig +short TXT _dmarc.yourdomain.com that the new records are now publicly visible and that there are no duplicate lines or unclosed quotation marks.
Next, send a test email from your work email account and another from a WordPress form to a personal Gmail account. Open the message, select Show original and make sure all three statuses appear in green: SPF: PASS, DKIM: PASS y DMARC: PASS.
You might also be interested in Tutorials
Resources and Support
We offer a variety of resources to help you become familiar with and understand your resources and opportunities, and to enjoy the benefits of having a digital infrastructure. In addition, we have social programs to support startups and projects with exclusive benefits.
