One of the most common questions when building AI agents is: how do I give my agent a real email address it can use to sign up for services, receive OTPs, and send messages? This guide answers that question in four steps.
Step 1: Create an AgentMailr Account
Sign up at agentmailr.com and create an API key. The API key identifies your organization and controls access to your inboxes.
Step 2: Create an Inbox for Your Agent
POST https://api.agentmailr.com/v1/inboxes
X-API-Key: ak_your_key
Content-Type: application/json
{
"name": "research-agent-01"
}
Response:
{
"id": "inb_abc123",
"address": "research-agent-01@agentmailr.com"
}
Step 3: Use the Address in Your Agent
Pass research-agent-01@agentmailr.com as the email input whenever your agent needs to register or verify identity. You can hardcode this for a persistent agent, or create a new inbox per task for ephemeral agents.
Step 4: Receive Emails via API or MCP
When the verification email arrives, retrieve it:
GET /v1/inboxes/inb_abc123/otp?timeout=60
Or if you are using Claude or Cursor, connect via the MCP server and use the get_otp tool directly.
Persistent vs Ephemeral Inboxes
- Persistent: Create the inbox once, reuse it. Good for agents with long-running identities.
- Ephemeral: Create a new inbox per task, delete when done. Good for one-off automations where you want clean isolation.
Custom Domains
You can connect your own domain so your agent uses agent@yourcompany.com instead of @agentmailr.com. Add the domain via the dashboard, verify DNS, and it is ready in minutes.