Migrate from Mailgun.
Same SMTP shape on send. Different inbound — typed reply events instead of raw bodies. MCP-native distribution. Self-serve metered pricing coming soon. ~30 minutes of changes.
Four reasons.
Inbound webhooks go from raw → typed
Mailgun delivers body-plain / body-html / stripped-text and you classify. Mails.ai delivers an event with intent, entities, urgency, injection_score, and sender_reputation pre-computed by our classifier (opt-in).
Native prompt-injection scanning on every inbound
Every inbound runs a six-category injection scanner. Mailgun has no equivalent — agent attack defense is 100% your responsibility there.
MCP-native distribution
npx @mailsai/mcp-server drops mails.send / mails.onReply into Claude Code, Cursor, Cline. Mailgun has no MCP surface.
Self-serve at every volume
Mailgun Foundation $35/50K, Growth $80/100K. Mails.ai Pro $20/50K (sends + parses) / Scale $99/250K (sends) + 500K (parses). The Metered tier (coming soon) extends past every Mailgun tier with no Enterprise gate.
Send + receive, side by side.
// Mailgun — send + raw inbound webhook
const mg = require("mailgun-js")({ apiKey, domain });
mg.messages().send({
from: "sarah@yourcompany.com",
to: "lead@example.com",
subject: "Demo",
text: "...",
});
// Inbound webhook delivers raw body-plain, body-html, attachments
app.post("/inbound", (req, res) => {
const { sender, subject, "body-plain": body } = req.body;
// Classify intent + extract entities yourself
});// Mails.ai — typed reply event with intent + entities pre-computed
import { mails } from "@mailsai/sdk";
const agent = mails.agent("sarah", { domain: "yourcompany.com" });
await agent.send({ to: "lead@example.com", subject: "Demo", body: "..." });
agent.onReply((event) => {
// event.intent / entities / urgency / injection_score / sender_reputation
});Built for agents.
Self-serve at every volume.
Public API opens Q3 2026. Drop ~6 lines into your agent and ship.
$ npm install @mailsai/sdk