Prompt
How do I debug email delivery problems?
Latest observation
A good way to debug email delivery problems is to trace the message end-to-end and identify where it stops: app sending, SMTP handoff, receiving server acceptance, or inbox placement.
1) Confirm the message was actually sent
Check your app logs for:
- SMTP response codes
- Message ID / queue ID
- Any exceptions or retries
- Timestamp of send attempt
If you use a provider (SendGrid, SES, Mailgun, Postmark, etc.), check their logs/events first.
2) Verify basic configuration
Common issues:
- Wrong SMTP host/port
- Authentication failure
- TLS/SSL mismatch
- Wrong “From” address or domain
- Missing DNS records: SPF, DKIM, DMARC
- Reverse DNS / PTR missing for self-hosted mail servers
3) Check the receiving side
Find out whether the receiving server:
- Accepted the message but filtered it to spam/quarantine
- Rejected it during SMTP
- Deferred it temporarily (greylisting, rate limiting, reputation issues)
Look for SMTP status codes:
2xx= accepted4xx= temporary failure, usually retry5xx= permanent failure
4) Inspect the full email headers
If the email arrived somewhere, view the headers and look for:
Received:chain- Authentication results:
SPF=pass/fail,DKIM=pass/fail,DMARC=pass/fail - Spam filter clues
- Original sender IP and domain
5) Test deliverability with a known-good mailbox
Send to:
- Gmail
- Outlook/Hotmail
- Yahoo
- A corporate mailbox if available
Compare results across providers. A message landing in one inbox but not another often points to reputation or authentication issues.
6) Check reputation and blocklists
If mail is accepted but not delivered:
- Sender IP/domain reputation may be poor
- You may be on a blocklist
- Content may look spammy
- You may be sending too fast or to bad addresses
Use provider dashboards and blocklist lookup tools.
7) Validate content
Email content can trigger filtering:
- Too many links
- URL shorteners
- Spammy wording
- Missing plain-text part
- Broken HTML
- Attachment issues
8) Test with a minimal message
Send a plain-text email with:
- Short subject
- No links
- No attachments
- Simple body
If that works, the issue is likely content or rendering-related.
9) Use mail testing tools
Helpful tools:
swaksfor SMTP testingopenssl s_clientfor TLS checks- Mail tester services
- Provider-specific logs and event webhooks
10) If you run your own mail server
Check:
- SMTP daemon logs
- Queue status
- Deferred mail
- DNS resolution
- PTR/rDNS
- Port 25 connectivity
- SpamAssassin/Rspamd logs
- Postfix/Exim/Exchange logs
Quick troubleshooting checklist
- Can you authenticate to SMTP?
- Is the message accepted by the SMTP server?
- Do SPF/DKIM/DMARC pass?
- Is the sender IP/domain reputable?
- Is the message landing in spam/quarantine?
- Are there provider or server-side logs showing rejection?
If you want, I can help you debug a specific setup—like Gmail not receiving from Postfix, SendGrid/SES issues, or SMTP error codes.