mailfleet
v0.1.0
Published
Official SDK for MailFleet — the transactional email API without the enterprise tax. 50,000 emails for $10/mo, SAML/SSO at $99 instead of a sales call.
Downloads
157
Maintainers
Readme
mailfleet
Official SDK for MailFleet — the transactional email API without the enterprise tax.
- 50,000 emails for $10/month (free tier: 3,000/month, no card)
- SAML/SSO, audit logs and SLA at $99/month — a checkbox, not a sales call
- Per-customer sender isolation on AWS SES: someone else's bad list can't hurt your deliverability
- Zero-dependency SDK. Node 18+, serverless, edge, Bun, Deno.
Install
npm install mailfleetQuickstart
import { MailFleet } from "mailfleet";
const mailfleet = new MailFleet(process.env.MAILFLEET_API_KEY!);
const { id } = await mailfleet.send({
from: "Acme <[email protected]>", // a domain you verified in the dashboard
to: "[email protected]", // string or array, up to 50
subject: "Your receipt",
html: "<p>Thanks for your order!</p>",
});Get an API key in three steps: sign up (free), verify your sending domain (3 DKIM CNAME records, shown in the dashboard), create a key. ~5 minutes end to end — full docs.
Sending
await mailfleet.send({
from: "Acme <[email protected]>",
to: ["[email protected]", "[email protected]"],
subject: "Maintenance window tonight",
text: "We'll be offline 02:00–02:15 UTC.",
replyTo: "[email protected]",
});At least one of html / text is required. from must use a verified domain.
Error handling
Every failure throws a typed MailFleetError with a machine-readable code:
import { MailFleet, MailFleetError } from "mailfleet";
try {
await mailfleet.send({ ... });
} catch (e) {
if (e instanceof MailFleetError) {
switch (e.code) {
case "quota_exceeded": // plan limit reached — e.limit tells you the cap
case "domain_not_verified": // finish DNS verification in the dashboard
case "account_paused": // deliverability protection kicked in
case "invalid_api_key":
default: // validation_error | all_recipients_suppressed | send_failed | network_error
}
}
}| code | HTTP | meaning |
| --- | --- | --- |
| invalid_api_key | 401 | Missing/revoked key |
| validation_error | 422 | Bad request shape (fields, recipient count) |
| domain_not_verified | 403 | from domain isn't verified for your account |
| account_paused | 403 | Bounce/complaint thresholds exceeded — deliverability protection |
| quota_exceeded | 429 | Monthly plan limit reached (error.limit = your cap) |
| all_recipients_suppressed | 422 | Every recipient previously hard-bounced or complained |
| send_failed | 502 | Upstream provider error |
Hard-bouncing and complaining addresses are suppressed automatically — MailFleet protects your sender reputation by default.
Why MailFleet
MailFleet is built for product email — receipts, magic links, verification codes, alerts. Transparent flat pricing, no deliverability add-on upsells, and the enterprise checkboxes (SAML/SSO, audit logs, SLA) on a self-serve $99 plan. Comparisons: vs Resend · vs SendGrid.
Links
Docs · Pricing · Acceptable use · [email protected]
MIT © MailFleet
