Home β€Ί APIs β€Ί Mailgun

Mailgun API β€” pricing, free tier & how to get a key

Mailgun is a long-running transactional & bulk email API built for developers, known for deliverability tooling, detailed analytics and EU/US data regions. Here's the pricing, what the free trial really gives you, and how to get a key.

Mailgun pricing (reference, July 2026)

PlanPriceEmails
Trial free$0limited trial sends (~100/day), capped period
Basicfrom ~$15/mo~10,000 / mo included, pay-as-you-go above
Foundationfrom ~$35/mo~50,000 / mo, more domains & analytics
Scale / Enterprisecustomhigh volume, dedicated IPs, SLA
⚠️ Reference prices, July 2026 β€” Mailgun changes plan names and included volumes often. Confirm on mailgun.com/pricing. Extra emails beyond the plan are billed per thousand; dedicated IPs and validation cost extra. Β· Report outdated price β†’
βœ“ Last verified: 2026-07-15Β· Source: official provider pricing pageΒ· Auto-monitored β€” report change β†’

The free tier

Mailgun's free offering is a time-limited trial with a small daily send cap (roughly 100/day), not a generous forever-free plan. If you need ongoing free transactional email, Resend (3,000/month free) or Amazon SES (~$0.10 per 1,000) are usually a better fit. Mailgun earns its keep once you're sending real volume and want validation, deliverability analytics and EU data residency.

How to get a Mailgun API key (step by step)

1. Sign up at mailgun.com and pick your region (US or EU).
2. Add your domain under Sending β†’ Domains and add the SPF, DKIM and tracking CNAME DNS records Mailgun shows you, then verify.
3. Go to Settings β†’ API Keys.
4. Copy your Private API key (keep it secret; the public key is only for email validation).

Send a test email:

# replace $MG_API_KEY and YOURDOMAIN
curl -s --user "api:$MG_API_KEY" \
https://api.mailgun.net/v3/YOURDOMAIN/messages \
-F from="you@YOURDOMAIN" \
-F to="to@example.com" \
-F subject="Hi" \
-F text="Hello from Mailgun"

Cheaper / alternative options

Amazon SES is cheapest at scale (~$0.10 per 1,000) but bare-bones. Resend (see our Resend guide) wins on free tier and developer experience. SendGrid (see the SendGrid guide) adds marketing-email features. Mailgun sits between them: strong deliverability tooling and EU regions, mid-market pricing. For SMS instead of email, see Twilio.

FAQ

Does Mailgun have a free tier?

Only a limited trial (~100 emails/day for a capped period), not a forever-free plan. For ongoing free sending, Resend (3,000/mo) or Amazon SES are better.

How do I get a Mailgun API key?

Sign up, add and verify your domain via SPF/DKIM/CNAME DNS records, then Settings β†’ API Keys and copy the Private API key.

Is Mailgun or SendGrid cheaper?

They're close at mid volumes (~$15–35/mo tiers). SendGrid has more marketing features; Mailgun has stronger deliverability analytics and EU data regions. At very high volume, Amazon SES undercuts both.

Does Mailgun offer EU data residency?

Yes β€” you can choose an EU region at signup so email data is processed in the EU, which helps with GDPR requirements.

Not affiliated with Mailgun. Prices are reference estimates β€” always verify on the official pricing page.

Host your project:DigitalOcean β€” $200 free β†—Hostinger VPS

Tools & Hosting

πŸ“ˆ TradingViewπŸ”’ NordVPNπŸ’³ RevolutDigitalOcean $200HostingerMeshy AI