Python SDK for the MultiMail API — email infrastructure for AI agents.
pip install multimail
from multimail import MultiMail mm = MultiMail("MULTIMAIL_API_KEY") # List mailboxes mailboxes = mm.list_mailboxes() mailbox_id = mailboxes[0]["id"] # Enable signed AI disclosure on a mailbox when needed mm.update_mailbox(mailbox_id, ai_disclosure=True) # Send an email result = mm.send_email( mailbox_id, to=["recipient@example.com"], subject="Hello from my agent", markdown="This email was sent by an AI agent using **MultiMail**.", ) print(result) # {"id": "...", "status": "pending_scan", "thread_id": "..."} # Check inbox emails = mm.list_emails(mailbox_id, direction="inbound") # Read a specific email email = mm.get_email(mailbox_id, emails["emails"][0]["id"]) print(email["subject"], email["text_body"])
from multimail import AsyncMultiMail async with AsyncMultiMail("MULTIMAIL_API_KEY") as mm: mailboxes = await mm.list_mailboxes() await mm.update_mailbox(mailboxes[0]["id"], ai_disclosure=True) result = await mm.send_email( mailboxes[0]["id"], to=["recipient@example.com"], subject="Async email", markdown="Sent asynchronously!", )
MultiMail supports graduated oversight modes. When a mailbox uses gated_send, emails require human approval:
# List emails waiting for approval pending = mm.list_pending() # Approve or reject mm.decide(pending[0]["id"], "approve") mm.decide(pending[1]["id"], "reject", reason="Not relevant")
MultiMail handles regulatory compliance at the infrastructure layer — no SDK-side code changes needed:
- EU AI Act Article 50: Every AI-sent email includes a cryptographically signed
ai_generateddisclosure in theX-MultiMail-Identityheader whenai_disclosureis enabled on the mailbox - 38 MCP tools: The hosted and local MCP server expose 38 tools on top of the same compliance-aware delivery infrastructure
- US State Laws: Maine, New York, California, Illinois — AI disclosure built into email delivery
- CAN-SPAM: Unsubscribe headers and physical address footers on all outbound email
- Formally Verified: Lean 4 proofs of identity header tamper evidence
See multimail.dev/use-cases/eu-ai-act-email-compliance for details.
get_account()/update_account(**fields)/delete_account()
list_mailboxes()/create_mailbox(address, display_name, oversight_mode=..., ai_disclosure=False)/update_mailbox(id, **fields)/delete_mailbox(id)
list_emails(mailbox_id)/get_email(mailbox_id, email_id)/send_email(mailbox_id, to=, subject=, markdown=)/reply_email(mailbox_id, email_id, markdown=)/cancel_email(mailbox_id, email_id)/get_thread(mailbox_id, thread_id)/download_attachment(mailbox_id, email_id, filename)
get_tags(mailbox_id, email_id)/set_tags(mailbox_id, email_id, tags)/delete_tag(mailbox_id, email_id, key)
list_contacts(q=)/add_contact(email, name=)/delete_contact(contact_id)
list_pending()/decide(email_id, action, reason=)
list_api_keys()/create_api_key(name, scopes=)/revoke_api_key(key_id)
list_webhooks()/create_webhook(url, events, secret=)/delete_webhook(webhook_id)
list_domains()/add_domain(domain)/verify_domain(domain_id)/delete_domain(domain_id)
list_suppressions()/remove_suppression(address)
get_usage()/get_audit_log(limit=)
from multimail import MultiMail, AuthenticationError, RateLimitError mm = MultiMail("MULTIMAIL_API_KEY") try: mm.send_email(mailbox_id, to=["test@example.com"], subject="Hi", markdown="Hello") except AuthenticationError: print("Invalid API key") except RateLimitError as e: print(f"Rate limited, retry after {e.retry_after}s")
- MultiMail — Homepage
- API Docs — Full API reference
- MCP Server — For Claude, Cursor, and other MCP clients