All terms
Glossary·Distribution

Automatic mail

Email sent programmatically by an AI agent or automated system — triggered by logic, events, or schedules — without a human composing or approving each message.

Automatic mailis email sent by an AI agent or automated program rather than a human author. The agent decides the content, recipient, and send timing in response to events, schedules, or logic branches — no human drafts or approves each individual message. Every reply the agent receives is routed back as a structured reply event the agent can act on.

How automatic mail differs from email marketing

Email marketing tools (Mailchimp, Klaviyo, HubSpot) are built for humans managing campaigns: a person writes the message, defines the audience, and sets a send time. Automatic mail inverts that model — the agent is the author, the scheduler, and the reader of replies.

  • Author.The agent composes each message dynamically, based on the triggering event — a user action, a threshold breach, a workflow step.
  • Scheduler. The agent decides when to send based on program logic rather than a calendar a person configured.
  • Reader. Replies flow back to the agent as typed events, not to a human inbox.

Standard transactional email services (SES, Postmark, Resend) handle delivery but stop there. They have no concept of agent identity, no inbound reply routing, and no per-agent reputation isolation. Automatic mail pipelines need all three.

The three layers automatic mail requires

  • Agent identity.Each agent needs a stable sending address — e.g. support@yourapp.mails.ai— that routes replies back to the agent, not to a shared human inbox.
  • Inbound parsing. Replies must be parsed before the agent can act on them. The inbound parsing layer pre-computes intent, entities, urgency, and injection_score so the agent reads a typed object instead of raw MIME.
  • Per-agent reputation. An agent that sends at high volume needs its own sender reputation tracked separately. The reputation graphisolates each agent so one misbehaving sender can’t degrade deliverability for the entire workspace.

Sending automatic mail with Mails.ai

The Mails.ai send endpoint accepts a JSON body with the agent identity, recipient, subject, and message body. The agent address is provisioned once and reused across all sends:

import Mails from "@mailsai/sdk";

const client = new Mails({ apiKey: process.env.MAILS_API_KEY });

// Provision the agent address once; reuse the agentId on every send
const agent = await client.agents.create({ name: "notify" });

// Send automatic mail when an event fires in your system
await client.messages.send({
  agent: agent.id,
  to: "user@example.com",
  subject: "Your report is ready",
  body_text: "Your weekly digest is attached.",
});

// Replies route back as typed events
client.events.on("message.received", async (event) => {
  if (event.injection_score > 0.5) return; // skip suspicious inbound
  console.log(event.intent, event.entities);
});

If your agent runs inside Claude Code, Cursor, or another MCP-compatible host, the Mails.ai MCP server exposes mails.send, mails.receive, and mails.get_reputationas native tools — no SDK import required.

Scheduled vs. event-driven automatic mail

Automatic mail falls into two sub-patterns by trigger:

  • Scheduled automatic mail.Fires at a fixed time — a daily digest, a weekly report, a birthday reminder. The agent wakes on a cron and sends to its list.
  • Event-driven automatic mail.Fires on a condition — a user completes a signup, a build fails, a balance crosses a threshold. The agent responds to the event and sends within milliseconds.

Both patterns need the same infrastructure: an agent address, inbound routing for replies, and per-agent reputation tracking.

Common automatic mail use cases

  • Support agents. An AI agent monitors a support address, reads inbound requests as structured events, and sends automatic replies when it can resolve the issue without human escalation.
  • Notification agents. An agent watching a data pipeline sends automatic mail when a build fails, a threshold is crossed, or a report is ready.
  • Document-parse agents. An agent receives attachments via inbound email, extracts structured data, and replies automatically with the parsed result.
  • 2FA and auth agents. An agent reads a verification code from an inbound automatic mail and passes it back to the browser automation workflow, removing the human from the authentication step.

Deliverability for automatic mail

High-volume automatic mail is more deliverability-sensitive than human-composed mail because the send pattern is regular and predictable — inbox providers have tuned filters for it. Key signals to monitor:

  • DKIM signing and SPF alignment on every send. Mails.ai handles both by default.
  • Bounce and complaint rates tracked per agent address via the reputation graph, so a single high-volume agent doesn’t affect others sharing the same domain.
  • Volume ramp: new agent addresses warm up gradually before sending at full rate. The classifier enforces this automatically.

Deliverability state is queryable per agent from the dashboard or the mails.get_reputation tool on the MCP server.

Getting started

The fastest path from zero to a working automatic mail pipeline is the quickstart guide— one API key, one agent address, and a send call you can run in under five minutes. For MCP-native workflows, install the Mails.ai MCP server and your agent can send and receive mail without any SDK or HTTP wiring.

Frequently asked questions

What is the difference between automatic mail and spam?
Spam is unsolicited bulk email sent to people who didn’t ask for it. Automatic mail is transactional or agent-triggered email sent to people who have a relationship with the sender — a user who signed up, a customer who placed an order, or a recipient who initiated a conversation with an AI agent. The key distinction is consent and relevance, not the sending mechanism.
Can any email provider send automatic mail?
Any SMTP provider can deliver outbound messages. What standard providers lack is the infrastructure for the return path: inbound parsing that converts replies into typed events, per-agent identity isolation, and per-agent reputation tracking. Without those layers the agent is blind to replies and shares reputation with every other sender on the domain.
How does automatic mail handle replies?
When a recipient replies to an automatic mail, the reply is received by the inbound parsing layer, which extracts intent, entities, and an injection score from the raw MIME message. The result is delivered to the agent as a typed event— a structured object the agent can pattern-match against without parsing email headers itself.
Is automatic mail suitable for high-volume sends?
Yes, with proper warm-up. New agent addresses ramp gradually — sending too much too soon from a cold address triggers spam filters regardless of content quality. Mails.ai enforces a warm-up schedule automatically and surfaces reputation metrics per agent so you can monitor deliverability as volume scales.
Live now

Built for agents.
Self-serve in minutes.

The API is live and self-serve. Drop ~6 lines into your agent and ship.

npmpnpmbunnpx
$ npm install @mailsai/sdk
Live on npm today · @mailsai/sdk + @mailsai/mcp-server