A message sent between addresses over the internet using SMTP — the foundational transport layer that AI agents use to communicate with humans and other systems.
Email(electronic mail) is the internet standard for sending messages between addresses. Built on SMTP, email is the most widely adopted asynchronous communication channel — and the foundation that AI agents build on when they need to reach humans or other systems outside their own runtime.
How email works
At its core, email moves a message from a sender address to a recipient address through a chain of mail servers. The key protocols and records involved:
- SMTP(Simple Mail Transfer Protocol) — the transport protocol that delivers the message from the sending server to the recipient’s mail server.
- MX records— DNS entries that tell SMTP where to deliver mail for a given domain.
- SPF, DKIM, DMARC— authentication records that prove the sender is authorized to send from that domain and that the message was not tampered with in transit.
- MIME— the encoding format that wraps headers, body text, HTML, and attachments into a single email message.
Email as infrastructure for AI agents
For AI agents, email is not a human inbox — it is an API surface. The agent sends email programmatically via an HTTP call and receives replies as structured data rather than raw MIME. This requires three layers that standard email providers do not offer:
- Per-agent addresses. Each agent gets its own sending address (e.g.
support@yourapp.mails.ai) so identity and sender reputation are isolated. - Inbound parsing. The inbound layer converts raw email replies into typed events with intent, entities, and injection score— the agent reads structured data, not MIME.
- Reputation isolation. The reputation graphtracks deliverability metrics per agent so one agent’s volume spike does not affect others on the same domain.
Sending email from an AI agent
The Mails.ai API wraps SMTP so agents send email with a single HTTP call. No SMTP connections, no TLS negotiation, no manual DKIM signing:
import Mails from "@mailsai/sdk";
const client = new Mails({ apiKey: process.env.MAILS_API_KEY });
// Send email from an agent address
await client.messages.send({
agent: "ag_support",
to: "user@example.com",
subject: "Your request has been processed",
body_text: "The file you uploaded has been parsed. See results attached.",
});For agents running inside Claude Code, Cursor, or another MCP-compatible host, the Mails.ai MCP serverexposes email send and receive as native tools — no SDK import required.
Email vs. chat, webhooks, and other channels
AI agents can communicate through many channels. Email has properties that make it distinct:
- Universal reach. Every person and business has an email address. Chat platforms (Slack, Teams, Discord) require the recipient to be on the same platform.
- Asynchronous by default. Email does not require both parties to be online at the same time. Webhooks are real-time and require an always-on receiver.
- Auditable.Email creates a durable, timestamped record of every exchange — useful for compliance, support history, and debugging agent behavior.
- Bidirectional. Unlike webhooks (push-only), email supports replies. The agent sends, the human replies, and the reply routes back to the agent as a typed event.
Deliverability fundamentals
Sending email is easy. Getting it into the inbox is the hard part. The key signals that inbox providers evaluate:
- Authentication. SPF, DKIM, and DMARC must all pass. Mails.ai configures these automatically for every agent address.
- Reputation. Sending history, bounce rates, and spam complaint rates tracked per agent via the reputation graph.
- Warm-up. New agent addresses ramp send volume gradually. The classifier enforces warm-up schedules automatically.
- Content. The injection scanner flags suspicious inbound content before the agent processes it.
Frequently asked questions
- What is email?
- Email (electronic mail) is a method of sending digital messages between addresses over the internet. It uses SMTP for delivery, along with DNS records like MX, SPF, DKIM, and DMARC for routing and authentication. Email remains the most widely adopted asynchronous communication channel on the internet.
- How do AI agents use email?
- AI agents use email as a bidirectional communication channel. The agent sends outbound email through an API — composing subject, body, and recipient programmatically — and receives inbound replies as structured typed events. Each agent gets its own email address, isolating identity and reputation from other agents on the same domain.
- What is the difference between email and an email API?
- Email is the protocol and message format (SMTP, MIME). An email API is a programmatic interface that wraps SMTP so applications and AI agents can send and receive email with a single HTTP call instead of managing SMTP connections, TLS, DKIM signing, and bounce handling directly.
- Why do AI agents need their own email addresses?
- Sharing a single address across multiple agents means one agent’s spam complaints or bounces degrade deliverability for every other agent on that address. Per-agent addresses let the reputation system track and isolate each agent independently, so a misbehaving sender does not affect the rest of the workspace.
Built for agents.
Self-serve in minutes.
The API is live and self-serve. Drop ~6 lines into your agent and ship.
$ npm install @mailsai/sdk