EMAIL API

Send email with one API call — from your own server.

A clean REST API for transactional and broadcast mail: single sends, batches, scheduling, idempotency, tags, and attachments. Same endpoint, your IP, your logs, your reputation — via Postal under the hood, not a rented SES pool.

One call to send. Everything else is a field.

POST to /emails with a from, a to, and a body. Add scheduling, tagging, or idempotency by adding a key — no new endpoints, no separate marketing product to bolt on.

POST /emails

Send in one request

HTML or plain text, reply-to, CC/BCC, custom headers, and file attachments in a single JSON body. Get back a message ID you can trace all the way to delivery in your own logs.

// npm i mailstein import { Mailstein } from 'mailstein'; const mailstein = new Mailstein(process.env.MAILSTEIN_API_KEY); await mailstein.emails.send({ from: 'billing@boardpearls.com', to: 'user@example.com', subject: 'Your receipt', html: '<p>Thanks for your order.</p>', tags: [{ name: 'type', value: 'receipt' }], });

Built for real sending, not just the happy path.

01 / BATCH

Send up to 100 at once

POST an array to /emails/batch to fan out per-recipient messages in a single round trip. Each entry carries its own subject, body, and tags — ideal for digests and per-user notifications.

02 / SCHEDULE

Schedule for later

Add scheduled_at with an ISO timestamp or a natural offset like in 1 hour. mailstein holds the message and releases it at send time — no cron of your own required.

03 / IDEMPOTENT

Idempotency keys

Pass an Idempotency-Key header and a retried request returns the original result instead of sending twice. Safe to replay after a timeout, a webhook redelivery, or a crashed worker.

Tag it, attach it, then find it again.

Every send is queryable. Tags flow into analytics and webhooks; attachments ride along in the same request; every message lands in logs you host.

TAGS & METADATA

Label every send

Attach key/value tags — type=receipt, tenant=acme — and they show up on the message, in delivery/open/bounce webhooks, and in analytics filters. Slice deliverability by whatever dimension your product cares about.

Debugging "did the password-reset go out?" becomes a tag filter, not a grep through a third party's dashboard.
ATTACHMENTS

Files in the same call

Include base64 content or a URL plus a filename and content type. PDFs, CSVs, and ICS invites go out inline — no separate upload step, no signed-URL dance.

Invoices and calendar invites send in the same request that triggers them, so there's no window where the email exists but the file doesn't.

Reach it however you build.

SDK

Typed SDKs

Idiomatic clients with full types for the send, batch, schedule, and suppression calls — so your editor autocompletes the payload and catches a wrong field before you ship it.

CLI

Command line

Send a test, tail your event stream, and manage domains and API keys from the terminal. Wire it into CI to fire a smoke-test email on every deploy.

MCP

MCP for agents

An MCP server exposes the same send and lookup tools to Claude and other agents, so an assistant can send and verify mail through your infrastructure — no scraping a dashboard.

SMTP

Or skip the API entirely

Point any existing app, framework mailer, or off-the-shelf tool at mailstein over SMTP with a generated username and password. Same IP, same SPF/DKIM/DMARC signing, same suppression list, same logs as the REST API — migrate without rewriting your mail layer.

# SMTP credentials from your dashboard host = smtp.mailstein.com port = 587 user = ms_live_xxxxxxxxxxxx pass = **************** # TLS on 587, or implicit TLS on 465

One API. Transactional and broadcast. Your infrastructure.

Free tier is 50 emails a month on one domain — no card. Wire up a send in a couple of minutes.

Start free