Quickstart
Send your first transactional email through NextMail in under ten minutes. Steps below assume you've created a tenant — sign up at /portal if you haven't.
1. Verify a sending domain
Add a subdomain (e.g. mail.yourbrand.com) so your root domain's mail reputation isn't affected by sends. Paste the three records NextMail generates into your DNS provider.
Records to add:
- SPF — TXT on
@, declares NextMail's mail servers are authorized to send - DKIM — TXT on
nextmail._domainkey, the public half of a 2048-bit RSA keypair (private key stays on our side, encrypted) - DMARC — TXT on
_dmarc, policy starting atp=nonewith reports going to NextMail
Verification runs every 30 seconds; usually completes in 1-5 minutes depending on DNS propagation.
2. Issue an API key
Head to API keys and click Create key. Give it a name (e.g. "Production") and a scope. The raw key is shown once; store it in your secret manager immediately.
# .env
NEXTMAIL_KEY=nm_live_a1b2c3d4_REVEALED_ONCE_ONLY_e9f0a1b2c3d43. Send your first email
With curl, the REST API directly:
curl https://api.nextmail.io/v1/emails \
-H "Authorization: Bearer $NEXTMAIL_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "noreply@mail.yourbrand.com",
"to": "you@example.com",
"subject": "Hello from NextMail",
"html": "<p>It worked.</p>",
"text": "It worked."
}'Or, with the official Node SDK:
import { NextMail } from '@cybersquad/nextmail';
const mail = new NextMail({ apiKey: process.env.NEXTMAIL_KEY! });
await mail.send({
from: 'noreply@mail.yourbrand.com',
to: 'you@example.com',
subject: 'Hello from NextMail',
html: '<p>It worked.</p>',
});4. Watch it land
Open the live logs tab in your portal — every send, every delivery event, every bounce shows up in real time. Open and click events follow within seconds of the recipient interacting.
Next steps
- Add a webhook so your app reacts to bounce / complaint events automatically
- Create a template so subject + body live in NextMail, not in your codebase
- Read about the full API surface