For developers

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. 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. 2

    Verify your domain

    Add the sender’s domain under Domains and publish the DNS records shown. Verification is automatic.

  3. 3

    Send your first email

    A single POST. The 202 answer comes right away with the message id; delivery happens in the background.

curl
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
POST/v1/messagesSend an email (HTML and/or text, cc, bcc, reply-to)
GET/v1/messages/{id}A message’s status: sent, delivered, bounced, complaint
POST/v1/eventsAn event that starts or stops automations
GET/v1/openapi.jsonThe OpenAPI 3.1 spec, no authentication

Errors

All errors have the same shape: { "error": "…", "message": "…" }

401 unauthorized402 insufficient_credits403 sender_not_verified413 too_large422 invalid_to429 rate_limited

A transactional email, from code to inbox

For AI

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.

Example request for your AI assistant

Read 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.

Next steps