Sentroy vs Mailgun
Mailgun is a long-standing, high-volume managed mail platform. Sentroy is an open, self-hostable platform where mail is bundled with storage, auth, and env management. This page is an honest side-by-side so you can pick the right one — and a migration snippet if you decide to switch.
Quick comparison#
The five questions most teams care about when picking a transactional email vendor.
| Sentroy | Mailgun | |
|---|---|---|
| Pricing model | Flat platform tier; send volume not metered per email | Per-email tiered (Foundation / Growth / Scale plans) |
| Self-hostable | Yes — Postfix/Dovecot/Rspamd stack ships as IaC | No — managed SaaS only |
| Open formats | MJML templates, raw MIME, IMAP-backed inbox | Handlebars templates, raw HTML, route receiver |
| Lock-in | Low — standards-based, exportable, self-host path | Moderate — proprietary API, region-locked dashboards |
| Bundled with other products | Storage + auth + env vault + status pages, one tenant | Email-focused (validate, inbox placement add-ons) |
What is the same#
The places these two products meaningfully overlap.
- Both expose REST APIs and SMTP for transactional send.
- Both handle DKIM, SPF, and DMARC verification.
- Both ship per-domain webhooks with HMAC-signed payloads.
- Both support template variables, attachments, and bulk-friendly recipient arrays.
- Both expose suppressions and bounce / complaint handling.
- Both maintain a queryable mail log for delivery debugging.
What is different#
Honest differences in both directions.
Where Sentroy is different
- Self-hostable end-to-end — the production Postfix/Dovecot/Rspamd stack is the same one shipped to operators.
- Multilingual templates as a first-class field shape; no application-side locale switching needed.
- IMAP-backed inbox API — read replies, list folders, mark-as-read, thread by subject, all from the same client.
- Same access token reaches storage / auth / env vault — one credential, one billing line.
- Flat platform pricing — high-volume bursts don't spike the bill.
Where Mailgun is different
- Massive scale operator — petabyte-class send infrastructure across multiple regions.
- Inbox placement and email validation services available as paid add-ons.
- Email parsing "routes" for incoming mail handling — mature, well-documented.
- EU and US regional accounts for data residency without self-hosting.
- Longer track record on regulated industry compliance (HIPAA BAAs, etc.).
When to pick Sentroy#
Concrete situations where Sentroy is the better call.
- You want a bundled platform — email plus storage, auth, and config — instead of stitching four vendors.
- You ship multilingual transactional email and want translations inside the template, not your app.
- Your ops team wants the option to self-host the entire mail stack on infrastructure you control.
- You need an inbox API for replies, not just a send API — support / reply-flow products benefit.
When to stick with Mailgun#
Cases where staying on Mailgun is the right call.
- You send millions of emails per day and need a vendor with proven multi-region throughput at that scale.
- You depend on Mailgun's validation or inbox-placement add-ons that don't have a 1:1 equivalent yet.
- You have a signed HIPAA BAA or a long-standing reputation IP pool you don't want to migrate.
Migration#
One operation, both APIs side by side.
Sending a transactional email with template variables:
import formData from "form-data"
import Mailgun from "mailgun.js"
const mailgun = new Mailgun(formData)
const mg = mailgun.client({ username: "api", key: process.env.MAILGUN_API_KEY! })
await mg.messages.create("acme.dev", {
from: "Acme <onboarding@acme.dev>",
to: "user@example.com",
subject: "Welcome to Acme",
template: "welcome",
"h:X-Mailgun-Variables": JSON.stringify({ name: "Jane" }),
})import { Sentroy } from "@sentroy-co/client-sdk"
const sentroy = new Sentroy({
baseUrl: "https://sentroy.com",
companySlug: "acme",
accessToken: process.env.SENTROY_ACCESS_TOKEN!,
})
await sentroy.send.email({
from: "onboarding@acme.dev",
to: "user@example.com",
subject: "Welcome to Acme",
domainId: "<acme-domain-id>",
templateId: "<welcome-template-id>",
variables: { name: "Jane" },
})Mailgun's h:X-Mailgun-Variables header becomes a typed variables object on Sentroy; both feed the same template substitution at send time.