Prompt
How do I track whether emails sent from my app were delivered?
Latest observation
Sep 23, 2026
OpenAI APIWeb search: off
To track whether emails sent from your app were delivered, you generally need to use your email provider’s delivery events / webhooks rather than relying on your app alone.
Key point
Your app can usually know:
- Sent: you handed the message to an email service/SMTP server
- Delivered: the recipient’s mail server accepted it
- Opened / clicked / bounced / complained: only if your provider supports tracking and the recipient client allows it
Recommended approach
1. Use an email service provider with event tracking
Examples:
- SendGrid
- Mailgun
- Amazon SES
- Postmark
- Resend
- SparkPost
These providers can send webhook events such as:
accepted/sentdeliveredbouncedeferredopenclickspam complaint
2. Store a message ID for each email
When you send an email, save:
- internal email record ID
- provider message ID / webhook ID
- recipient
- template name
- timestamp
- status
This lets you correlate webhook events back to your app record.
3. Receive webhooks from the provider
Set up an endpoint in your app to receive events and update the email status in your database.
Example statuses:
queuedsentdeliveredbouncedfailed
4. Distinguish “delivered” from “read”
- Delivered = recipient mail server accepted it
- Read/opened = tracked indirectly, often unreliable
- Many email clients block open tracking images, so open tracking is approximate
If you use raw SMTP
SMTP alone usually only tells you:
- the server accepted the message for delivery
It does not reliably tell you whether it reached the inbox or whether the user read it. You’d need:
- DSN/bounce handling, if supported
- provider logs
- or switch to a transactional email provider with webhooks
Basic implementation pattern
- Send email via provider API
- Save provider message ID in DB
- Configure webhook endpoint
- On
delivered, mark record as delivered - On
bounce, mark as bounced/failed
Example data model
{
"id": "email_123",
"to": "user@example.com",
"subject": "Welcome!",
"provider_message_id": "abc-xyz-123",
"status": "delivered",
"sent_at": "2026-09-23T10:00:00Z",
"delivered_at": "2026-09-23T10:00:05Z"
}
Important caveats
- “Delivered” means accepted by the recipient’s mail server, not necessarily inbox placement.
- Gmail/Yahoo/Outlook may still filter to spam or promotions.
- Open tracking is imperfect due to privacy features.
- If you’re sending marketing email, you should also monitor bounce/complaint rates and authenticate with SPF, DKIM, and DMARC.
If you want, I can show you how to do this with a specific provider like SendGrid, SES, or Mailgun, including webhook code.