Skip to main content
v1.0 - open source· Star on GitHub

Email infrastructure
you actuallyown.

One API across SendGrid, Postmark, Mailgun, and SES. Templates, suppressions, webhooks, and ML-routing live at the platform layer - not your provider's. Switch in one click. No code changes. No lost emails.

Free 50k/mo·No credit card·SOC 2 evidence built-in·MIT-licensed
send-welcome.tsbun run
1import { Optail } from '@optail/sdk';
2
3const mail = new Optail({ apiKey: 'ot_live_…' });
4
5// One call. We pick the best provider for this send.
6await mail.send({
7 from: 'team@yourapp.com',
8 to: 'jane@example.com',
9 template: 'welcome-email',
10 data: { name: 'Jane', plan: 'Growth' },
11});
routed → SendGrid · 98 ms · delivered ✓

One API · every major provider · already supported

SG
SendGrid
PM
Postmark
MG
Mailgun
SES
Amazon SES
RS
Resend
SP
SparkPost
MJ
Mailjet
SMTP

// the lock-in tax

Email providers were never meant to be your data layer.

But that's where everything ends up - templates, suppressions, analytics, identity. Switching becomes a migration project. Deliverability tuning becomes vendor-specific. Compliance is whatever they offer.

Templates trapped in vendor dashboards

Your MJML, your variables, your translations - re-keyed every time you migrate. Marketing waits. Engineering re-implements. Bugs ship.

Suppression lists that don't travel

Bounces and unsubscribes live inside SendGrid (or Postmark, or Mailgun). Switch and you've forgotten who told you to leave them alone - that's a CAN-SPAM violation, not just bad UX.

One outage = one lost release

When your single provider has a bad afternoon, your password resets queue up. Multi-provider failover means rewriting half your sending code - so nobody does.

// how it works

One layer between your app and every email provider.

01

Send to one endpoint

Use the Optail SDK or REST API. One request shape, regardless of which provider eventually touches the wire.

$ mail.send({ template: "welcome", to })
02

Routing decides

Rules-based for the cases you know. ML-based for the ones you don't. Routes by domain, tag, ISP history, time-of-day, cost - and auto-fails over.

$ ↳ postmark · 98 ms · circuit:closed
03

State stays with you

Templates, suppressions, events, opens, clicks - versioned and queryable in Optail. Your provider becomes interchangeable plumbing.

$ SELECT * FROM optail.events WHERE …

// why optail

More than an abstraction. An intelligence layer.

Replacing your provider's SDK is the easy part. The reason teams stay locked in is everything else - and that's what Optail rebuilds at the platform layer.

warmup orchestrator

Bring an IP. Optail handles the ramp.

Connect a dedicated IP from any provider - SendGrid Pro, Postmark, SES dedicated. Optail schedules a per-ISP 14-stage volume ramp, routes overflow through warm pools, and pauses the schedule the moment bounce rate steps out of bounds.

warmup schedule · pool=ip-1 · day 7/1410k/day
d1d2d3d4d5d6d7d8d9d10d11d12d13d14
$optail.warmup.start({ pool: 'ip-1' })stage 7/14·0 throttles
AI dev copilot

Ask "why did Gmail bounce?" in chat.

An embedded agent that reads your sends, your suppression list, your DNS, and your provider events - then explains, fixes, or hands you a curl.

rca engine

Root-cause analysis, not dashboards.

When deliverability drops, an engine correlates blocklist hits, DNS regressions, content signals, volume spikes, and per-ISP patterns into a ranked report with remediation actions - many auto-applied.

analyzers: blocklist · dns · content · spike · ISP-specific

platform-owned templates

MJML + Handlebars, versioned in Optail.

Compile once, send through any provider. Roll back to any version. Preview with sample data. Health-checked for spam triggers before they ship.

multi-level suppressions

Org · domain · group · user.

HMAC-signed unsubscribe links, suppression state portable across providers, full SendGrid-parity policy hierarchy. CAN-SPAM and GDPR-clean by default.

instant failover

Switch providers in one click.

Outage on Postmark? Promote SendGrid as default before the page completes its incident. No code changes, no redeploy, no in-flight loss.

normalized webhooks

One event shape. Every provider.

Bounce codes parsed and categorized by interpreter. Soft, hard, transient, blocked - same schema whether the source is SES or Mailgun.

Predictive routing
Send-time optimizer
Anomaly detection
Cost optimizer
Forecasting
A/B testing
Custom domains
Bounce interpreter

// intelligence layer

The smartest provider for this send, every send.

Most "multi-provider" tools round-robin. Optail trains a per-org model on your own send history and scores every provider in real time. When something goes wrong, an RCA engine isolates the cause before a human pages.

predictive-routing.score(provider, send)

Six features. One probability. Per provider.

Each provider gets a live score for this exact send. The model retrains as you send. New providers cold-start with sensible priors and learn within hours.

isp delivery history0.92
time-of-day performance0.78
email-type affinity0.84
current load factor0.62
cost efficiency0.71
circuit health1.00
winner: postmark
p(deliver) = 0.96
rca-engine · live trace

"Why did Gmail start bouncing at 2:02pm?"

Ask in chat or trigger by alert. The engine correlates signals across providers, DNS, content, and volume - and proposes a fix it can run.

14:02:11Gmail bounce rate spiked to 4.1% (baseline 0.8%)
14:02:11Cross-checking SendGrid pool reputation…
14:02:13DNSBL: not listed
14:02:13Content scan: HIGH risk phrase in template welcome-v17
14:02:14Recommended: roll back template welcome-v17 → v16
14:02:14✓ auto-applied · monitoring next 200 sends

// for developers

The SDK you'd write yourself.

First-class clients in Node, Python, Go, and Ruby. Typed end-to-end. Idempotency keys built in. Streaming responses for batch sends. Open-source under MIT - read the code, fork it, host it.

identical shape · all SDKs
import { Optail } from "@optail/sdk";

const mail = new Optail({ apiKey: process.env.OPTAIL_KEY! });

await mail.send({
  to: "jane@example.com",
  template: "welcome-email",
  data: { name: "Jane", plan: "Growth" },
  // optional: pin to a provider, otherwise the model picks
  // provider: "postmark",
});
$ bun add @optail/sdkJS / TS
$ pip install optailPython
$ go get github.com/optail/optail-goGo

// enterprise plane

Trust isn't a tab. It's the product.

The enterprise features ship in the open-source core - no separate SKU, no walled garden. Self-host or use our cloud, the controls are the same.

SOC 2 readyGDPRHIPAA-friendlyISO 27001 path

SOC 2 evidence, continuous

Each control has a live evidence collector. Auditors get a real-time link, not a PDF dump.

Region-pinned data residency

EU, US, or self-hosted. PII never leaves the region you choose. Audit log proves it.

SSO + audit logs

SAML & OIDC for any IdP. Every config change, key rotation, and send-as-user emits a signed audit event.

Encryption at rest + in flight

AES-256 for templates, suppressions, and event store. Per-org KMS keys on enterprise.

CAN-SPAM · GDPR · ePrivacy

HMAC-signed unsubscribe links, suppression hierarchy, and DPA on file. The compliance plumbing is the product.

Security score, live

A 0–100 grade across DKIM, SPF, DMARC, BIMI, MTA-STS, TLS-RPT - with one-click remediation.

// open source

MIT-licensed.
Self-host or use our cloud.

Optail is open source the way developer tools should be: no "open core" tax, no enterprise-only features behind a wall. The same code we run in production is the code on GitHub.

optail / optailMIT

Open-source email infrastructure. One API across SendGrid, Postmark, Mailgun, SES - with ML routing, RCA, and full deliverability tooling.

Stars
2.4k
Forks
187
Contributors
38
$ git clone https://github.com/optail/optail
$ docker compose up

// ship today

Stop renting your email layer.
Own it instead.

Free up to 50,000 emails/month. No credit card. Five minutes from npm install to first send.

$ bun add @optail/sdk