Email Spam Tester

Home › Integrations › Guides › SendGrid

Guide · no connection needed

Testing SendGrid emails

SendGrid is really two senders under one login, the Marketing Campaigns screens and the Email API. They put different headers on your mail, so they get tested a little differently.

Guide · SendGrid

Test an email from SendGrid

One address, one email, valid for an hour. No account, no API key.

Get a test address

Step 1

Authenticate the domain

Domain authentication: a CNAME at em[0000], two DKIM CNAMEs and a DMARC TXT.

Step 2

Send one real email to a test address

A Single Send to a one-contact list, or one curl call to /v3/mail/send.

Step 3

Read the report

Look for "via sendgrid.net", the alignment lines and the unsubscribe headers.

A newsletter built in Single Sends and a password reset sent through /v3/mail/send can leave the same SendGrid account and still arrive as quite different emails, which matters for a spam test. Marketing Campaigns always tries to add unsubscribe headers, while the API adds them only if you asked it to, so decide which of the two you are testing before you send anything.

The receiving end is the same for both. Email Spam Tester gives you a temporary address, no account needed. Only the first message that arrives within the hour counts, and it gets a report covering authentication, SpamAssassin and Rspamd verdicts, content, the Bulk sender rules that Gmail and Yahoo set, and 21 blocklists queried with your sending IP.

Single Sends: the test button and its prefix

The built-in test lives at Marketing > Single Sends. Open the Single Send, find Test Your Email, type the test address and click Send Test Message. SendGrid wants a sender and a subject before it lets you test, and a subject with Handlebars needs Test Data filled in. On the way out, SendGrid puts Test - in front of the subject line.

For the real thing, send the Single Send to a list. Single Sends go to lists or segments, so make a list with the test address as its only contact and pick it under Recipients. Now the headers, the unsubscribe link and the tracked links are the ones a subscriber gets. If you also took the inbox test, its provider inboxes can join that list.

The API and SMTP: one curl command

Trimmed from SendGrid's getting-started example, with the test address as recipient:

curl --request POST \
  --url https://api.sendgrid.com/v3/mail/send \
  --header 'Authorization: Bearer <<YOUR_API_KEY>>' \
  --header 'Content-Type: application/json' \
  --data '{"personalizations":[{"to":[{"email":"test-xxxxxxxxxxxxxxxxxxxx@t.email-spam-tester.com"}],"subject":"Hello, World!"}],"content":[{"type":"text/plain","value":"Heya!"}],"from":{"email":"you@yourdomain.com","name":"Your Name"}}'

When the inbox test is on, your provider inboxes go into the same to array and the marker goes into subject, so the one request also tells you which folder Gmail, Outlook, Yahoo and other providers put the email in.

Paste in your own test address and a From that SendGrid has verified, through single sender verification or domain authentication. Better still, send the message your app actually sends, with its real HTML, because the content checks will grade what's in the body.

If your application talks SMTP, nothing changes except the transport. The host is smtp.sendgrid.net, the username is literally the string apikey (not your key), and SSL runs on port 465.

There is also a test-send endpoint, POST /v3/marketing/test/send_email. It takes up to 10 addresses but works only with Dynamic Transactional Templates, so for most API mail the plain Mail Send call above is the honest test.

Unsubscribe headers depend on the path you chose

Marketing Campaigns tries to add List-Unsubscribe headers every time. Mail sent through the API or SMTP gets them only when Subscription Tracking is switched on under Settings > Tracking. In that case SendGrid inserts List-Unsubscribe with an HTTPS link and List-Unsubscribe-Post: List-Unsubscribe=One-Click.

Without Subscription Tracking you add the headers yourself in the request:

"headers": {
  "List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
  "List-Unsubscribe": "<mailto:unsubscribe@yourdomain.com>, <https://yourdomain.com/unsubscribe>"
}

SendGrid asks for both the mailto and the https part, and warns against unsubscribing anyone on a plain GET to that link. Be careful copying from SendGrid's support article on these headers. Its second sample sets List-Unsubscribe-Post to URLs, which is wrong. The value is always List-Unsubscribe=One-Click. Our List-Unsubscribe fix page has the rest.

If the message is a password reset or a receipt and carries no list headers, the report marks the Bulk sender rules group as skipped instead of failing it. A newsletter sent through the API doesn't get that pass.

Reading the authentication results

On an account without domain authentication, recipients see "via sendgrid.net" after your From address, and SendGrid's docs say domain authentication removes it. The report goes further than the tag. Look at the DKIM and SPF alignment lines. If the signature or the return path belongs to a SendGrid domain rather than yours, DMARC can't pass for your From, and the plan should point you to domain authentication. Sending From a gmail.com or yahoo.com address is worse. SendGrid's DMARC page says both SPF and DKIM fail for those, and the console itself warns that such messages might fail a DMARC check.

Domain authentication lives in Settings > Sender Authentication. With automated security on, which is the default, SendGrid gives you four records:

  • a CNAME at em[0000], which covers SPF and becomes your return path;
  • CNAMEs at s1._domainkey and s2._domainkey for DKIM;
  • a TXT at _dmarc with v=DMARC1; p=none;.

Example values. Copy the real ones from your account.

NameTypeValueWhat it is forCopy
Automated security on (the default)
em[0000]CNAMEThe target from your accountSPF and the return path.
s1._domainkeyCNAMEThe target from your accountDKIM.
s2._domainkeyCNAMEThe target from your accountDKIM, the second selector.
_dmarcTXTv=DMARC1; p=none;DMARC.
Automated security off
em[0000]MXThe host from your accountThe return path.
em[0000]TXTv=spf1 include:sendgrid.net ~allSPF, which you look after yourself.
m1._domainkeyTXTThe key from your accountDKIM.

With automated security off, you get an MX and an SPF TXT (v=spf1 include:sendgrid.net ~all) at em[0000], plus a DKIM TXT at m1._domainkey, and you look after the SPF record yourself. If your DNS provider rejects CNAME names that contain _, that is the only option. And if another service already uses the selector s, SendGrid lets you pick a custom one. Check the result with the DKIM checker (selector s1) and the SPF checker, which also counts DNS lookups if your SPF record is getting crowded.

Click tracking rewrites every link. If your link text is itself a URL, the visible address and the real target stop matching, and the report's link mismatch check will flag it. SendGrid's deliverability page points out the same problem. Use words as link text, or set up link branding so the tracked links run through your own domain, which has to match your From domain.

Trial and Essentials plans send from shared IP pools, which SendGrid notes can change without notice if your reputation changes, so a blocklist hit on one of them concerns everyone in that pool. The blocklist checker lets you look the IP up again later. Reverse DNS is configurable only with a dedicated IP, which comes with Pro Email API and Advanced Marketing Campaigns.

Questions

Why do my emails show "via sendgrid.net"?

SendGrid hasn't authenticated your sending domain yet. Set up domain authentication under Settings > Sender Authentication and, according to SendGrid's documentation, the tag goes away.

The report says List-Unsubscribe is missing, but I use SendGrid. Why?

You probably send through the API or SMTP with Subscription Tracking off. Either turn it on in Settings > Tracking or add both headers yourself in the headers object.

Can I use SendGrid's "Send Test Message" for this?

Yes, it reaches the test address. Just remember the subject arrives with Test - in front, and for headers exactly as subscribers get them, a Single Send to a one-contact list is closer.

Can I use the test-send API endpoint instead of Mail Send?

Only for Dynamic Transactional Templates, which is all /v3/marketing/test/send_email accepts. It takes up to 10 addresses. Everything else goes through /v3/mail/send.

Which selector do I type into the DKIM checker?

With automated security on, check s1 and s2. With it off, the selector is m1. If you chose a custom selector during setup, use that one instead.

Guides for other platforms

All integrations and guides →

Test an email now

One address, one email, valid for an hour. No account. The report builds itself as the checks finish.

Get a test address