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.
The three layers automatic mail requires
Standard transactional email services (SES, Postmark, Resend) cover delivery only. Automatic mail pipelines need two additional layers:
- 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: intent, entities, urgency, and injection_score pre-computed 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 reputationtracked separately, so one misbehaving agent can’t degrade deliverability for others in the same 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);
});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, not per domain, so a single high-volume agent doesn’t affect others.
- Volume ramp: new agent addresses warm up gradually before sending at full rate. The classifier enforces this automatically.
Mails.ai surfaces deliverability state per agent via the sender reputation graph (queryable from the dashboard or the mails.get_reputation MCP tool) and the classifier score on every send response.
Built for agents.
Self-serve in minutes.
Public API opens Q3 2026. Drop ~6 lines into your agent and ship.
$ npm install @mailsai/sdk