Programmable email · Node.js

Programmable email in Node.js

Drive email entirely from Node.js: send with one call, receive every inbound message as parsed JSON on a webhook, and give any app or AI agent its own inbox on a domain you control — with no mail server to run.

Start free Quickstart

Install

Add the Node.js library:

install · Node.js
npm install mailkite

Send an email

One endpoint, one API key — over your own authenticated domain. Send API reference →

send · Node.js
import { MailKite } from "mailkite";

const mk = new MailKite(process.env.MAILKITE_API_KEY);

const { id, status } = await mk.send({
from: "hello@myapp.ai",
to: "ada@example.com",
subject: "Your invoice #1042",
html: "<p>Thanks! Receipt attached.</p>",
});

Receive email as a webhook

Point your domain's MX at MailKite and every message arrives as parsed JSON — verify the signature, then handle it. No IMAP, no mail server.

receive · Node.js
import express from "express";
import { MailKite } from "mailkite";

const SECRET = process.env.MAILKITE_WEBHOOK_SECRET;
const app = express();
app.use("/hooks/mailkite", express.raw({ type: "application/json" }));

app.post("/hooks/mailkite", (req, res) => {
if (!MailKite.verifyWebhook(req.headers["x-mailkite-signature"], req.body, SECRET)) {
return res.sendStatus(401);
}
const event = JSON.parse(req.body.toString("utf8"));
// ...handle event.type === "email.received"
// Confirm receipt: returns the JSON body {"status":"ok"}.
res.type("application/json").send(MailKite.replyOk());
});

Go deeper: Parse inbound email to JSON in Node, or give an AI agent its own inbox.

Everything programmable email does

Send, receive, and agent inboxes — the same shape in every language. See the full picture →

Unlimited domains ·Unlimited mailboxes ·3,000 emails/mo — 100 emails/day. Pricing →