SendGrid (now Twilio) and Mailgun (now Sinch) are the two mature transactional email providers. They've converged on similar features but diverged on pricing and support. After running both across 6 customer deployments, here's the honest comparison.
Pricing at the tiers that matter
| Volume / month | SendGrid | Mailgun | Cheaper |
|---|---|---|---|
| 5,000 emails | Free | Free (trial), 35 USD Foundation | SendGrid |
| 10,000 emails | 20 USD (Essentials 40k) | 35 USD (Foundation 10k) | SendGrid |
| 50,000 emails | 20 USD (Essentials 40k) + overage | 35 USD (Foundation 50k included) | Mailgun |
| 100,000 emails | 90 USD (Pro 100k) | 90 USD (Growth 100k) | Tie |
| 500,000 emails | 249 USD (Pro 700k) | 215 USD (Scale 500k) | Mailgun |
| Dedicated IP | Pro 90 USD includes 1 | Scale 90 USD includes 1 | Tie |
Below 50k: SendGrid cheaper. Above 50k: Mailgun cheaper. The crossover happens because SendGrid's Essentials plan caps at 40k included and overage adds up fast.
Deliverability
Both have strong deliverability when properly configured. The variable that matters more than vendor choice: are you sending from your own domain with correct DKIM, SPF, and DMARC?
Industry deliverability benchmarks (June 2026):
- SendGrid inbox placement: 87-91% (varies by sender reputation)
- Mailgun inbox placement: 86-90%
- Postmark: 92-95% (boutique, more expensive at scale)
- Amazon SES: 80-85% (cheaper but worse sender reputation handling)
The single biggest factor: dedicated IP. Above 100k emails per month on a shared IP, you inherit reputation noise from other senders. Pay the 90 USD for Pro/Growth to get one.
DKIM / SPF / DMARC setup
Both providers walk you through DNS records during onboarding. Steps for SendGrid:
- Dashboard → Sender Authentication → Authenticate Your Domain
- Enter your domain, pick a DNS host (Cloudflare etc.)
- Add 3 CNAMEs SendGrid provides (DKIM + SPF) to your DNS
- Click Verify (DNS propagation can take 30 min to 24 h)
- Add DMARC TXT record:
v=DMARC1; p=quarantine; rua=mailto:[email protected]
Mailgun: identical flow with different domain names. Both require subdomain delegation (recommend mg.yourdomain.com or email.yourdomain.com, not the bare domain).
Template engines
SendGrid Dynamic Templates: visual editor + Handlebars syntax. WYSIWYG, version control built in. Good for marketing-adjacent teams.
Mailgun Templates: simpler — store HTML in the dashboard or pass at send time. Less visual, more developer-centric.
For most teams: store templates in code (use Jinja, Handlebars, or MJML locally), pass rendered HTML in the API call. Don't depend on the vendor's editor — keeps templates version-controlled in git.
API ergonomics
SendGrid Python SDK:
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
message = Mail(
from_email="[email protected]",
to_emails="[email protected]",
subject="Hi",
html_content="<p>Hello</p>"
)
sg = SendGridAPIClient(os.environ["SENDGRID_API_KEY"])
response = sg.send(message)
Mailgun via requests:
requests.post(
f"https://api.mailgun.net/v3/{domain}/messages",
auth=("api", os.environ["MAILGUN_API_KEY"]),
data={
"from": "[email protected]",
"to": "[email protected]",
"subject": "Hi",
"html": "<p>Hello</p>"
}
)
Both are simple. SendGrid's SDK is more featured (built-in retry, batching). Mailgun's plain HTTP is easier to debug.
Webhooks for delivery events
Both push events back to your endpoint: delivered, opened, clicked, bounced, complained, unsubscribed. Standard webhook security applies (verify signature, idempotent processing).
Use webhook events to:
- Update user table with bounce status (don't send to bounced addresses)
- Track engagement (opens, clicks) for product metrics
- Handle unsubscribes immediately
- Flag spam complaints for review
Support quality
SendGrid since Twilio acquisition: support quality is hit-or-miss on lower tiers. Pro plan customers get reasonable response times.
Mailgun since Sinch acquisition: similar pattern. Foundation tier support is documentation-only effectively.
For both: budget for being on your own with the docs unless you're paying for the enterprise tier.
When to pick which
- Pick SendGrid if: under 40k emails/month, want the most polished template UI, OK with Twilio's product evolution
- Pick Mailgun if: above 50k emails/month, developer team, prefer simpler API and routing rules
- Pick Postmark if: deliverability is mission-critical (password resets, 2FA), willing to pay 2x for it
- Pick Amazon SES if: you're already deep in AWS, can manage your own sender reputation, volume is very high (millions)
Comparison
| Feature | SendGrid | Mailgun |
|---|---|---|
| Free tier | 100/day forever | 30-day trial |
| Cheapest paid plan | 20 USD (40k) | 35 USD (50k) |
| Pro/Growth (100k + dedicated IP) | 90 USD | 90 USD |
| Template editor | Visual + Handlebars | Basic |
| API style | SDKs in all langs | REST + curl-friendly |
| Inbox placement (industry avg) | 87-91% | 86-90% |
| Best parent company | Twilio | Sinch |
| GDPR EU data residency | Yes (EU plan) | Yes (EU plan) |
FAQ
Should I use Amazon SES instead?
Cheaper (0.10 USD per 1k emails), no quota above the small free tier. Catch: you manage sender reputation, complaint handling, and config yourself. Worth it above 1M emails/month or if AWS-native is mandatory.
What about Postmark?
Excellent deliverability and support, especially for transactional. Roughly 2x the price of SendGrid/Mailgun at scale. Use when password resets and account verification absolutely must arrive.
Can I migrate from one to the other?
Yes — switch API keys + DNS records. Run both for 1 week, gradually shift traffic via a feature flag. Keep both warm to maintain IP reputation.
How do I handle bounces?
Both providers expose a bounce list via API and webhooks. Update your DB: mark addresses as bounced, don't send to them. Hard bounces = permanent (invalid address). Soft bounces = retry after 24h.
Email delivery dialed in
We set up SendGrid or Mailgun with DKIM, SPF, DMARC, webhooks, and bounce handling. Fixed-price 1 day.
Book a discovery call