AutoGPT is an autonomous AI agent framework that can perform long-horizon tasks. Adding email capability unlocks a huge class of real-world tasks: signing up for services, receiving OTPs, reading newsletters, and sending messages on behalf of the user.
Option 1: MCP Server (Easiest)
If your AutoGPT setup supports MCP tools, connect AgentMailr's hosted MCP server:
{
"url": "https://mcp.agentmailr.com/mcp",
"auth": { "type": "bearer", "token": "ak_your_key" }
}
The agent then has access to 30+ email tools including create_inbox, get_otp, send_email, and wait_for_email.
Option 2: REST API via HTTP Tool
If your AutoGPT setup includes an HTTP request tool, you can call the AgentMailr API directly. Common operations:
# Create inbox
POST https://api.agentmailr.com/v1/inboxes
X-API-Key: ak_your_key
{}
# Wait for OTP
GET https://api.agentmailr.com/v1/inboxes/{id}/otp?timeout=60
# Send email
POST https://api.agentmailr.com/v1/inboxes/{id}/send
{ "to": "user@example.com", "subject": "Hi", "text": "Hello" }
Use Cases
- Agent registers for a service, receives OTP, completes signup automatically
- Agent monitors a mailing list and summarizes weekly digest emails
- Agent sends status updates to a human via email
- Agent receives task instructions via email and acts on them
Security Note
AgentMailr wraps all inbound email content in untrusted content markers before returning it to agents. This prevents prompt injection attacks where a malicious sender tries to hijack the agent by embedding instructions in an email.