Send email from your code
A simple REST API for transactional email and automation events, with an OpenAPI spec and docs ready to hand to an AI assistant.
Start in 3 steps
- 1
Create an API key
In the app, under SMTP and API → New credential. The key is shown only once; keep it like a password.
- 2
Verify your domain
Add the sender’s domain under Domains and publish the DNS records shown. Verification is automatic.
- 3
Send your first email
A single POST. The 202 answer comes right away with the message id; delivery happens in the background.
curl -X POST https://api.mailtomany.com/v1/messages \
-H "Authorization: Bearer $MTM_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": { "email": "[email protected]", "name": "Your shop" },
"to": [{ "email": "[email protected]" }],
"subject": "Order #1042 is confirmed",
"html": "<p>Thanks for your order!</p>"
}'
# → 202 { "id": "msg_…", "accepted": 1, "suppressed": 0 }The API and SMTP come with the Pro and Business plans and with any valid credit pack.
Quick reference
- Base URL
https://api.mailtomany.com- Authentication
Authorization: Bearer mtm_live_…- Format
- JSON, UTF-8
- Limits
- 1,200 requests per minute; 50 recipients and 10 MB per message
/v1/messagesSend an email (HTML and/or text, cc, bcc, reply-to)/v1/messages/{id}A message’s status: sent, delivered, bounced, complaint/v1/eventsAn event that starts or stops automations/v1/openapi.jsonThe OpenAPI 3.1 spec, no authenticationErrors
All errors have the same shape: { "error": "…", "message": "…" }
401 unauthorized402 insufficient_credits403 sender_not_verified413 too_large422 invalid_to429 rate_limitedA transactional email, from code to inbox
Docs that AI assistants can read too
Working with ChatGPT, Claude, Cursor or Copilot? Give them our docs as plain text and they write the integration right the first time, with no made-up APIs.
https://mailtomany.com/llms.txtllms-full.txtAll the docs in one Markdown file, to paste into a chat or hand to an agent.https://mailtomany.com/llms-full.txtOpenAPI 3.1For Postman, client generators and AI tools that read specs./v1/openapi.jsonsecurity.txtWhere to report a security issue (RFC 9116)./.well-known/security.txtRead the mailtomany docs at https://mailtomany.com/llms-full.txt and write a function that sends the order confirmation email through the mailtomany API, using the key from the MTM_KEY environment variable and handling 402 and 429 errors.