Send order confirmations, receipts, and account notifications through AI agents at scale — with built-in CAN-SPAM compliance, DKIM signing, and delivery tracking.
Transactional emails — order confirmations, receipts, billing notifications, account alerts — need to reach inboxes reliably and comply with CAN-SPAM. When AI agents generate and send these emails, you need infrastructure that handles deliverability, identity authentication, and compliance automatically. Rolling your own SMTP pipeline means managing DKIM keys, handling bounces, maintaining sender reputation, and staying current with CAN-SPAM rules — all while ensuring your agent's output is accurate enough to send without manual review on every message.
MultiMail provides a single API that AI agents use to send transactional email with production-grade deliverability. DKIM signing, SPF alignment, bounce suppression, and CAN-SPAM footer compliance are built into the infrastructure — agents don't implement them. The monitored oversight mode lets agents send autonomously while giving your operations team a complete log of every message dispatched. Webhooks deliver real-time delivery, bounce, and complaint events back to your agent so it can update downstream systems without polling.
A business event — order placed, payment received, account created — triggers your agent. The agent receives structured data: order ID, customer email, line items, or account details, and proceeds to compose the transactional message.
The agent calls send_email via the REST API, Python SDK, or MCP tool. MultiMail validates the payload, applies DKIM signing to the sending domain, enforces CAN-SPAM header requirements, and queues the message for delivery.
MultiMail emits webhook events for delivered, bounced, deferred, and complained statuses. Metadata you attached at send time — order_id, user_id, event type — is included in every event payload so you can correlate delivery outcomes with business records.
Hard bounces are automatically suppressed at the infrastructure layer to protect sender reputation. Your webhook handler receives the bounce type and recipient address so downstream systems — CRM, order management — can be updated with accurate delivery status.
In monitored mode, every outbound transactional message is logged and visible to your team in real time. No approval gate delays delivery, but operators can review the full message history and intervene if the agent produces incorrect content — wrong totals, wrong recipient.
from multimail import MultimailClient
client = MultimailClient(api_key="mm_live_...")
def send_order_confirmation(order: dict) -> dict:
response = client.send_email(
from_mailbox="[email protected]",
to=order["customer_email"],
subject=f"Order "cm">#{order['id']} confirmed",
body=(
f"Hi {order[&"cm">#039;customer_name']},\n\n"
f"Your order has been confirmed and will ship within 2 business days.\n\n"
f"Order total: ${order[&"cm">#039;total']:.2f}\n"
f"Items: {&"cm">#039;, '.join(i['name'] for i in order['items'])}\n\n"
f"Track your order at https://acmecorp.com/orders/{order[&"cm">#039;id']}"
),
metadata={"order_id": order["id"], "event": "order_confirmed"}
)
return response
Send a transactional email from an AI agent using multimail-sdk. The SDK handles auth, retries, and surfaces delivery errors as exceptions.
curl -X POST https://api.multimail.dev/v1/emails/send \
-H "Authorization: Bearer $MULTIMAIL_API_KEY..." \
-H "Content-Type: application/json" \
-d &"cm">#039;{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Order #4821 confirmed",
"body": "Your order has been confirmed and will ship within 2 business days. Order total: $142.00.",
"metadata": {
"order_id": "4821",
"event": "order_confirmed"
}
}&"cm">#039;
Direct REST API call to send_email. Use when your agent runs in an environment without the Python SDK installed.
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/webhooks/multimail", methods=["POST"])
def handle_delivery_event():
event = request.get_json()
event_type = event.get("type")
metadata = event.get("metadata", {})
if event_type == "email.delivered":
order_id = metadata.get("order_id")
mark_confirmation_sent(order_id)
elif event_type == "email.bounced":
order_id = metadata.get("order_id")
recipient = event.get("to")
bounce_type = event.get("bounce_type") "cm"># "hard" or "soft"
if bounce_type == "hard":
flag_invalid_address(recipient, order_id)
elif event_type == "email.complained":
"cm"># CAN-SPAM: honor opt-outs within 10 business days
recipient = event.get("to")
unsubscribe_recipient(recipient)
return jsonify({"ok": True})
def mark_confirmation_sent(order_id: str): ...
def flag_invalid_address(email: str, order_id: str): ...
def unsubscribe_recipient(email: str): ...
Handle delivery status webhooks so your agent can update downstream systems. MultiMail suppresses hard bounces automatically, but your system needs to record which addresses failed.
{
"tool": "send_email",
"parameters": {
"from": "[email protected]",
"to": "[email protected]",
"subject": "Your account has been verified",
"body": "Your acmecorp.com account is now active. You can log in at https://acmecorp.com/login.\n\nIf you did not create this account, reply to this email immediately.",
"metadata": {
"event": "account_verified",
"user_id": "usr_8821"
}
}
}
Call the send_email MCP tool directly from a Claude Desktop or Cursor session when an agent needs to dispatch a transactional email as part of a longer workflow.
from langchain.tools import tool
from multimail import MultimailClient
client = MultimailClient(api_key="mm_live_...")
@tool
def send_order_receipt(order_id: str, customer_email: str, total: float) -> str:
"""Send a purchase receipt to the customer after checkout completes."""
response = client.send_email(
from_mailbox="[email protected]",
to=customer_email,
subject=f"Receipt for order #{order_id}",
body=(
f"Thank you for your purchase.\n\n"
f"Order: #{order_id}\n"
f"Total charged: ${total:.2f}\n\n"
f"Questions? Reply to this email or visit https://acmecorp.com/support"
),
metadata={"order_id": order_id, "event": "receipt_sent"}
)
return f"Receipt sent. Message ID: {response[&"cm">#039;message_id']}"
"cm"># Add send_order_receipt to your agent's tool list
Wire MultiMail's send_email into a LangChain agent as a tool so the agent can dispatch transactional emails mid-chain without leaving the framework.
MultiMail enforces CAN-SPAM requirements automatically: physical mailing address in the footer, accurate from-address, working unsubscribe mechanism, and compliant headers. Transactional emails have narrower obligations than marketing email, but MultiMail handles both. Agents do not implement compliance logic — it is enforced on every send.
Every email sent through MultiMail is signed with DKIM and aligned with your domain's SPF record. When you provision a custom-domain mailbox, MultiMail generates the DKIM keypair and provides DNS records to publish. After propagation, signing is automatic on every outbound message — no agent-side key management.
MultiMail delivers structured webhook events for delivered, bounced, deferred, and complained statuses. Metadata you attached at send time — order_id, user_id, event type — is echoed in every event payload, so your downstream systems stay accurate without maintaining a separate message-to-record mapping table.
Hard-bounced addresses are automatically suppressed from future sends at the infrastructure layer, protecting your domain's sender reputation without any agent-side logic. Bounce details — type, recipient, send metadata — are available via webhook for your CRM or customer database.
Monitored mode gives operations teams a complete audit log of every transactional email sent by your agents, with full message content and metadata. Delivery is not gated — confirmations reach customers in under a second — but operators can identify and remediate incorrect agent output without waiting for a customer complaint.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 50-tool MCP server. Formally verified in Lean 4.