Send Your First Transactional Email with MailAnvil in 5 Minutes
Send Your First Transactional Email with MailAnvil in 5 Minutes
You built an app. Now it needs to send emails — welcome emails, password resets, order confirmations. You need a transactional email API that doesn't suck.
MailAnvil is a developer-first transactional email API built on Cloudflare Workers + AWS SES. IDR pricing. QRIS/GoPay payments. MCP-native for AI agents. But today we're keeping it simple: REST API, curl, 5 minutes.
Step 1: Sign Up (30 seconds)
curl -X POST https://api.mailanvil.com/v1/signup \
-H "Content-Type: application/json" \
-d '{
"email": "you@example.com",
"password": "your-secure-password"
}'
Response:
{
"api_key": "key_01J...",
"customer": {
"id": "cus_01J...",
"email": "you@example.com",
"plan": "free"
}
}
Save that api_key — you'll use it for every request. It's only shown once.
Check your inbox for the verification email. Click the link to activate your account. Without verification, you can't send.
Step 2: Verify Your Domain (60 seconds)
MailAnvil won't send from unverified domains. This stops spammers and protects deliverability for everyone.
curl -X POST https://api.mailanvil.com/v1/domains \
-H "Authorization: Bearer key_01J..." \
-H "Content-Type: application/json" \
-d '{"domain": "example.com"}'
Response:
{
"id": "dom_01J...",
"domain": "example.com",
"dkim_status": "pending",
"dns_records": [
{
"type": "TXT",
"name": "_amazonses.example.com",
"value": "v=DKIM1; k=rsa; p=MIGfMA0G...",
"verified": false
},
{
"type": "TXT",
"name": "mailanvil._domainkey.example.com",
"value": "v=DKIM1; h=sha256; k=rsa; p=MIIBIjAN...",
"verified": false
}
]
}
Add those DNS records to your domain. If your DNS is on Cloudflare, MailAnvil auto-configures DKIM for you — zero manual steps. For other DNS providers, copy-paste the records.
Once added, verify:
curl -X POST https://api.mailanvil.com/v1/domains/dom_01J.../verify \
-H "Authorization: Bearer key_01J..."
Wait for DNS propagation (1-5 minutes). Response:
{
"id": "dom_01J...",
"dkim_status": "verified"
}
Green light. You're ready to send.
Step 3: Send Your First Email (30 seconds)
curl -X POST https://api.mailanvil.com/v1/send \
-H "Authorization: Bearer key_01J..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"from": "noreply@example.com",
"to": ["customer@their-inbox.com"],
"subject": "Welcome to My App!",
"html": "<h1>Welcome!</h1><p>Thanks for signing up. Your account is ready.</p>",
"text": "Welcome! Thanks for signing up. Your account is ready."
}'
Response: 202 Accepted
{
"email_id": "em_01J...",
"status": "queued"
}
202 means queued, not delivered. MailAnvil processes it through CF Queue → SES. Delivery happens in seconds.
The Idempotency-Key header prevents double-sends. Same key = same result. Use a UUID per unique email.
Step 4: Check Delivery Status
curl https://api.mailanvil.com/v1/emails/em_01J... \
-H "Authorization: Bearer key_01J..."
Response:
{
"id": "em_01J...",
"from": "noreply@example.com",
"subject": "Welcome to My App!",
"status": "delivered",
"recipients": [
{
"email": "customer@their-inbox.com",
"status": "delivered",
"delivered_at": "2026-07-19T12:00:05Z"
}
],
"created_at": "2026-07-19T12:00:01Z"
}
Boom. Email delivered.
Step 5: List All Your Emails
curl "https://api.mailanvil.com/v1/emails?limit=20" \
-H "Authorization: Bearer key_01J..."
Pagination: ?limit=50&offset=50. The dashboard at app.mailanvil.com shows all this visually.
What Just Happened Under the Hood
Your curl → API Worker (Hono.js, auth, validation)
→ CF Queue (at-most-once claim)
→ Consumer Worker (suppression check, DKIM verify)
→ AWS SES (ap-southeast-1, SigV4 signed)
→ Recipient inbox
Every step has guardrails: - DKIM verified domain required before sending (INV-1) - Suppression list checked — hard-bounced or complained addresses blocked (INV-2) - At-most-once per email ID — no duplicates even on retry (INV-3) - Automatic kill switch if bounce rate exceeds 5% or complaint rate exceeds 0.3% (INV-5)
Pricing: Pay in Rupiah
| Plan | Emails/mo | Price |
|---|---|---|
| Free | 500 | Rp 0 |
| Starter | 10,000 | Rp 149rb/bln |
| Growth | 100,000 | Rp 599rb/bln |
| Scale | 1,000,000 | Rp 2.9jt/bln |
All plans include DKIM, SPF, suppression list, webhooks, and the dashboard. No hidden per-email fees. Pay with QRIS, GoPay, or bank transfer.
Next Steps
- Full API docs — every endpoint, every error code
- MCP Server — let AI agents send email directly
- Dashboard — visual logs, domain management, billing
For Cloudflare DNS Users
If your domain is on Cloudflare DNS, MailAnvil auto-configures DKIM when you add a domain. No manual TXT records. No copy-paste. Just add the domain and we handle the rest. This is a MailAnvil exclusive — no other email API does this.
Got questions? Email support@mailanvil.com or open an issue on GitHub.
Start sending: app.mailanvil.com