How do I create my first inbox?
Creating an inbox gives your AI agent its own email address. You can create inboxes on the default @agentmail.to domain or on your own custom domain.
Install the SDK
Create an inbox
The inbox now has a unique email address (e.g., randomname@agentmail.to) and can send and receive emails immediately.
Customize your inbox
You can specify a username, domain, and display name:
Using a custom domain requires a verified domain. See the Creating Custom Domains guide to set one up. If you don’t specify a domain, AgentMail uses the default @agentmail.to domain.
Use client_id for idempotency
If your agent creates inboxes programmatically (e.g., on startup), use clientId to prevent duplicates. If an inbox with the same clientId already exists, AgentMail returns the existing inbox instead of creating a new one:
Send your first email
Once the inbox is created, you can send an email:
Always provide both text and html when sending emails. This ensures readability across all email clients and improves deliverability.
List your inboxes
Next steps
Now that you have an inbox, explore what you can do with it:
- Send and receive emails in a conversational loop
- Set up webhooks to get notified when emails arrive
- Use labels to track message state in your agent workflows
