You have built an AI agent that can reason, plan, and take actions. Now you need it to send an email. Maybe it needs to notify a customer, follow up on a lead, send a report, or respond to an incoming message. The problem is that most agent frameworks do not include email as a built-in capability.
This guide shows you how to send email from any AI agent using AgentSend. You will go from zero to sending your first agent email in under five minutes, with complete code examples in Python, Node.js, and cURL.
Step 1: Get Your API Key
Sign up for a free AgentSend account at agentsend.io/auth/signup. After signing up, you will find your API key in the dashboard. The free tier gives you 10 emails per day per inbox with no credit card required.
Step 2: Create an Inbox for Your Agent
Every agent needs its own email address. Create an inbox to get one:
curl -X POST https://agentsend.io/inboxes \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "My AI Agent"}' # Response: # { # "inboxId": "inbox_abc123", # "email": "abc123@agentsend.io" # }
Your agent now has an email address. Save the inboxId -- you will use it to send messages.
Step 3: Send Your First Email
With an inbox created, your agent can send emails immediately. Here are examples in three languages:
import requests response = requests.post( "https://agentsend.io/messages", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "inboxId": "inbox_abc123", "to": "recipient@example.com", "subject": "Hello from my AI agent", "text": "This email was sent by an autonomous AI agent." } ) print(response.json()) # {"messageId": "msg_xyz789", "status": "sent"}
const response = await fetch('https://agentsend.io/messages', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ inboxId: 'inbox_abc123', to: 'recipient@example.com', subject: 'Hello from my AI agent', text: 'This email was sent by an autonomous AI agent.' }) }); const result = await response.json(); console.log(result); // {messageId: "msg_xyz789", status: "sent"}
That is it. Three lines of meaningful code and your AI agent has sent an email. The recipient sees a normal email in their inbox -- they have no idea it was sent by an agent unless you tell them.
Step 4: Receive Replies via Webhook
Sending is only half the story. If the recipient replies, your agent needs to receive and process that reply. Update your inbox with a webhook URL:
curl -X PATCH https://agentsend.io/inboxes/inbox_abc123 \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"webhookUrl": "https://your-app.com/webhook/email"}'
Now when someone replies to your agent's email, AgentSend delivers the reply to your webhook as a JSON payload:
{
"from": "recipient@example.com",
"to": "abc123@agentsend.io",
"subject": "Re: Hello from my AI agent",
"text": "Thanks for reaching out! Can you tell me more?",
"threadId": "thread_def456",
"inboxId": "inbox_abc123"
}
Your agent processes the reply, generates a response, and sends it back using the same /messages endpoint. Include the threadId to keep the conversation in the same email thread.
Full conversation loop: Send -> Receive reply via webhook -> Process with AI -> Reply via API -> Receive next reply. Your agent can maintain multi-turn email conversations indefinitely.
Integrating with AI Agent Frameworks
AgentSend works with any AI framework. Here is how to add email as a tool in popular agent SDKs:
LangChain
Define a custom tool that calls the AgentSend API. Your LangChain agent can then decide when to send emails as part of its reasoning chain. See the LangChain integration guide for a complete example.
CrewAI
Give your CrewAI agents an email tool so crew members can communicate with external stakeholders. The sales researcher finds leads, the outreach agent emails them. See the CrewAI integration guide.
OpenAI Agents SDK
Register AgentSend as a function tool in your OpenAI agent. The agent calls it whenever it decides an email needs to be sent. See the OpenAI Agents integration guide.
Claude MCP
AgentSend is available as an MCP skill that Claude can use directly. Claude can create inboxes, send emails, and check for new messages as part of any conversation. See the Claude MCP integration guide.
Common Patterns
Outbound notifications
Your agent monitors a system and sends email alerts when something needs attention. A CI/CD agent emails the team when a build fails. A monitoring agent emails on-call when metrics exceed thresholds. A finance agent emails a summary of daily transactions.
Conversational workflows
Your agent sends an initial email and handles the back-and-forth. A sales agent sends a cold email, handles objections in the reply, and books a meeting. A support agent asks clarifying questions before providing a solution.
Scheduled reports
Your agent compiles data and emails a formatted report on a schedule. Daily analytics summaries, weekly team updates, monthly investor reports -- all composed and sent by your agent.
Multi-agent collaboration
Multiple agents communicate via email. A research agent emails its findings to an analysis agent, which emails a summary to a reporting agent. Each agent has its own inbox and processes messages independently.
Custom domains: On the Pro plan ($9/mo), send from your own domain. Your agent emails from agent@yourcompany.com instead of a generic address, improving deliverability and trust.
Frequently Asked Questions
How do I send email from an AI agent?
Create an inbox on AgentSend to get an email address for your agent, then use the REST API to send messages. A single POST request to /messages with the recipient, subject, and body is all it takes. AgentSend handles deliverability, authentication, and threading automatically.
Can my AI agent also receive email replies?
Yes. When you create an inbox, you can configure a webhook URL. Any email sent to your agent's address is delivered to that webhook as a JSON payload in real time. Your agent can process the reply and send a follow-up, enabling full conversational email flows.
Which AI frameworks work with AgentSend?
AgentSend works with any AI framework that can make HTTP requests. Popular integrations include LangChain, CrewAI, OpenAI Agents SDK, and Claude MCP. Since AgentSend is a REST API, it integrates with Python, Node.js, Go, or any language your agent is built in.
Is there a free tier for AI agent email?
Yes. AgentSend's free tier includes 10 emails per day per inbox with no credit card required. This is enough to build, test, and demo your AI agent's email capabilities before upgrading for production use.
Related Use Cases
- AI Email -- Deep dive into AI email: what it is, how it works, and how it compares to traditional tools.
- AI Mail Infrastructure -- Architecture patterns for multi-agent email systems.
- Customer Support Agent -- Build an agent that handles support email autonomously.
- Sales Outreach Agent -- Automate outbound email and qualify leads through conversation.
Send Your First Agent Email
Free tier available. No credit card required. Your agent can send its first email in under 5 minutes.
Start for Free →