Home / Email for Next.js
For Next.jsPassword resets, welcome emails, contact-form leads - most Next.js apps need to send mail sooner or later, and some need to receive it too. Mektup gives you both from a domain you own: one fetch() call to send from a Route Handler or Server Action, and a real mailbox behind it that can also receive replies.
Most Next.js email guides point you at a transactional-sending API: fire off a request, mail goes out, done. That covers password resets and receipts fine, but it's one-directional - there's no mailbox behind hello@yourapp.com for a customer's reply, a form submission, or a bounce to land in. Mektup runs real mail infrastructure behind the same kind of API call, so the address you send from is also a real inbox you (or your app) can read.
// app/api/send/route.ts export async function POST(req: Request) { const { to, subject, text } = await req.json(); const res = await fetch("https://api.usemektup.com/v1/emails", { method: "POST", headers: { Authorization: `Bearer ${process.env.MEKTUP_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ from: "hello@yourapp.com", to, subject, text, }), }); return Response.json(await res.json(), { status: res.status }); }
Same shape works in a Server Action, a Vercel Cron job, or an Edge runtime - it's a plain HTTPS POST, nothing Node-specific about it.
Add the domain your app runs on (or any domain you own) to Mektup, through the dashboard, the REST API, or by asking your AI coding agent to do it. You get back the exact MX, SPF, DKIM, and DMARC records.
Paste them wherever the domain's DNS lives - Cloudflare, Vercel Domains, Namecheap, wherever. This only touches MX and TXT records; your app's A/CNAME records for Vercel (or wherever it's hosted) are untouched, so the site keeps working exactly as it does today.
Create hello@yourapp.com, generate an API key, and set MEKTUP_API_KEY in your Next.js project's environment variables (locally in .env.local, and in your host's environment settings for production).
Use the snippet above from any Route Handler, Server Action, or scheduled job. Replies land in the same mailbox - read them in Mektup's webmail, over IMAP/SMTP in your own mail client, or through the API if you're building something like a support view directly into your app.
Getting started is free - 1 domain, 3,000 emails a month with no daily cap, and 3GB of storage, no credit card. See the full pricing.
No. Email is controlled by MX records; your app's hosting is controlled by A/CNAME records. They're independent, so you can keep your app on Vercel, Cloudflare, or anywhere else and add Mektup email on the same domain without touching your app's DNS.
No dedicated SDK is needed - Mektup's send endpoint is one JSON POST request, which works from a Route Handler, Server Action, or Edge runtime with plain fetch(). See the full REST API reference for every endpoint.
Yes. A Mektup mailbox is a real inbox - read it in Mektup's webmail or any mail client, and your app can list or read messages through the same REST API (or the MCP server, if an AI agent is building the integration) to power things like a support-ticket view.