Self-hosted email API

Email infrastructure you own.

MailForge sends through your own mail server and switches to AWS SES, Postmark or any SMTP relay when a provider fails. One API, one dashboard, on your own server.

  • Own MTA with DKIM signing
  • Multi-provider failover
  • Templates and tracking
import { Mailforge } from "@mailforge/node";

const mailforge = new Mailforge(process.env.MAILFORGE_API_KEY, {
  baseUrl: "https://mail.example.com"
});

const { data, error } = await mailforge.emails.send({
  from: "Acme <orders@acme.com>",
  to: "customer@example.com",
  subject: "Order 94821 confirmed",
  html: "<p>Thanks for your order.</p>"
});
202{ "id": "3f0c2a8e…", "status": "queued", "stream": "transactional" }
Failover

One provider goes down. Your email still goes out.

Most email APIs give you a single sending path. MailForge keeps an ordered chain of providers and works through it for every message.

  1. Ordered by priority and health. Each provider has a priority and a health score from 0 to 100.
  2. Failures cost health. A failed attempt lowers the score, a successful one raises it. Unhealthy providers are skipped.
  3. No change in your code. You call the same endpoint. The route is chosen per message.
Features

Everything between your code and the inbox.

What MailForge does today, without the marketing gloss.

Your own mail server

Send through your own MTA on your own IPs. MailForge signs each message with a 2048-bit DKIM key generated per domain.

Automatic failover

Add AWS SES, Postmark or any SMTP relay as a backup. When a provider fails, the next one in line takes the message.

Separate streams

Assign providers to transactional mail, marketing mail or both, so a campaign never touches the IPs your receipts depend on.

Scoped API keys

Give each service only what it needs, from emails:send to domains:write. Keys are stored as hashes and shown once.

Nothing gets lost

Every accepted email is stored in PostgreSQL before the API answers. Idempotency keys stop double sends, failed deliveries are retried, and hard bounces are suppressed for you.

Signed webhooks

Your server is told when an email is sent, bounces or fails. Every request is signed, retried for hours if you are down, and visible in a delivery log.

Schedule and batch

Send now or up to 30 days ahead, and cancel until the last moment. One request takes up to 100 emails, all or nothing.

A real test mode

Keys starting with mf_test_ run the whole pipeline, webhooks included, without sending anything. Simulator addresses let you rehearse bounces.

Templates with variables

Store an email once and send it by name with your data. Variables, defaults, if and each, with a live preview in the dashboard.

Open and click tracking

See opens, clicks and your most clicked links per domain and per email. Switch it off per domain, and exclude single links.

SDKs for Node.js and Python

Typed clients with automatic retries and idempotency keys built in. The Node.js SDK renders React Email components for you.

DNS that checks itself

Add a domain and get the exact DKIM, SPF and DMARC records to publish. One call verifies them against live DNS.

MailForge vs. Resend

Same simple API idea. You keep the infrastructure.

Resend is a hosted service: it runs the servers and you rent access. MailForge runs on your server, so the mail path, the data and the costs are yours to control.

ResendMailForge
Where it runsHosted serviceYour own server, in the region you choose
Sending infrastructureResend's infrastructureYour own MTA and IPs, plus any provider you connect
When a provider failsYou depend on one platformMail moves to the next provider automatically
Where your email log livesIn Resend's cloudIn your own PostgreSQL database
API key permissionsFull access or sending accessGranular permissions per area, with wildcards such as emails:*
Cost modelMonthly plans by email volumeNo per-email fee. You pay for your server and the providers you add.

The honest part: running your own mail server means you look after it, including IP reputation. Resend also offers things MailForge does not have yet, such as attachments, broadcasts to audiences and SDK packages published on npm and PyPI. The docs list exactly what is available today.

Get started

From clone to first email in three steps.

Own your email stack.

Read the quickstart and send your first email in a few minutes.