Prompt

My emails are going to spam and I don't know if it's my code or the provider. How do I debug this?

Technology / API Platforms1 observationLast seen Nov 3, 2026

Latest observation

Nov 3, 2026OpenAI APIWeb search: off

Debugging email deliverability is usually a process of isolating the cause, because spam placement can be affected by:

  • your code
  • your mail provider / sending IP
  • DNS/authentication setup
  • recipient reputation/history
  • email content and formatting

Here’s a practical way to debug it.

1) Split the problem into “sending” vs “deliverability”

First confirm:

  • Did the provider accept the message?
  • Did the recipient mailbox receive it, and where did it land?
  • Did it bounce, defer, or get silently filtered?

If you have SMTP logs or provider logs, look for:

  • 250 OK / accepted by provider
  • 4xx deferrals
  • 5xx rejections
  • complaint, bounce, or suppression events

If it’s accepted by the provider but lands in spam, it’s usually deliverability/reputation/authentication/content, not your SMTP code.

2) Check your authentication: SPF, DKIM, DMARC

These are the first things to verify.

SPF

  • Ensure your sending domain has an SPF record authorizing the provider’s sending servers.
  • Common issue: multiple SPF records. You should have only one SPF TXT record.
  • Make sure the envelope-from / return-path aligns reasonably with the domain.

DKIM

  • Make sure outgoing mail is being DKIM-signed.
  • Verify the signature is valid and the selector/domain match what’s published in DNS.
  • A broken DKIM signature is a very common reason for spam placement.

DMARC

  • Check your DMARC policy and whether alignment passes.
  • Start with monitoring (p=none) if you’re unsure.
  • Review DMARC aggregate reports for authentication failures.

Quick test: send a message to a Gmail/Outlook test inbox and inspect the headers. Look for:

  • SPF=PASS/FAIL
  • DKIM=PASS/FAIL
  • DMARC=PASS/FAIL

3) Inspect the full message headers

In a received spam message, view the raw headers and check:

  • Authentication-Results
  • Received chain
  • Message-ID
  • From, Return-Path, Reply-To
  • List-Unsubscribe (for bulk mail)
  • any spam scoring headers like X-Spam-Status

This can reveal:

  • SPF/DKIM/DMARC failures
  • mismatched domains
  • missing unsubscribe headers
  • suspicious relay behavior

4) Verify your sending IP/domain reputation

Even if the code is correct, reputation can be the issue.

Check:

  • whether you’re on a shared IP pool with bad neighbors
  • whether your IP/domain is listed on blocklists
  • whether your domain is new or has low sending volume
  • whether recipients are engaging or marking mail as spam

Useful checks:

  • Google Postmaster Tools
  • Microsoft SNDS / JMRP
  • MXToolbox blacklist checks
  • SenderScore-style reputation tools

5) Look at content and formatting

Spam filters can be triggered by the message body, HTML, or links.

Common issues:

  • too many images, too little text
  • URL shorteners
  • suspicious attachments
  • malformed HTML
  • hidden text or styling tricks
  • misleading subject lines
  • excessive punctuation / spammy words
  • mismatched visible link text vs actual URL
  • tracking domains with bad reputation

Test with:

  • plain text only
  • minimal HTML
  • no links
  • no attachments

If that lands in inbox while the full version doesn’t, the issue is likely content-based.

6) Check recipient behavior and list quality

If you’re sending to a list:

  • are addresses old or purchased?
  • are you seeing hard bounces?
  • are people opening/clicking?
  • are there spam complaints?

Poor engagement can hurt reputation quickly.

7) Test from multiple inboxes/providers

Send the same email to:

  • Gmail
  • Outlook/Hotmail
  • Yahoo
  • a custom domain inbox

Compare where it lands and inspect headers. This helps determine whether the issue is:

  • provider-specific
  • domain-specific
  • content-specific

8) Isolate your code

If you suspect the code:

  • send the exact same content through your provider’s dashboard UI if possible
  • compare headers from API-sent vs UI-sent messages
  • check for accidental header bugs:
    • malformed From
    • broken MIME structure
    • bad encoding
    • incorrect line endings
    • duplicate headers
    • invalid charset
    • missing MIME boundaries

A bug in MIME formatting can absolutely hurt deliverability.

9) Use seed testing and inbox placement tools

For more systematic testing:

  • send to seed addresses across major providers
  • use tools like GlockApps, Mail-Tester, or Litmus-style email testing
  • compare inbox vs spam placement and authentication results

10) Work through a simple diagnosis order

A good order is:

  1. Check provider logs
  2. Check SPF/DKIM/DMARC
  3. Inspect raw headers
  4. Test plain-text minimal email
  5. Check reputation/blocklists
  6. Review content and links
  7. Compare with provider-sent test email
  8. Test across Gmail/Outlook/Yahoo

Most common causes

In practice, the most common reasons emails go to spam are:

  1. missing or broken DKIM/SPF/DMARC
  2. bad sender reputation or shared IP issues
  3. low engagement / high complaints
  4. spammy content or bad HTML
  5. misconfigured return-path / From alignment
  6. provider-side throttling or suppression

If you want, I can help you debug it step by step. If you paste:

  • your sending method/provider
  • a redacted raw header from a spammed message
  • your SPF/DKIM/DMARC records

…I can help identify the likely cause.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.