Need help with our last invoice
Hi team!
We were charged twice on invoice #4821 last week. Could you take a look and refund the duplicate? Screenshot attached.
Best regards,
Sarah
Give your AI agent an inbox. Get notified the moment mail arrives, fetch parsed messages over the API, and reply in-thread.
Skip the custom MIME parsing, header extraction, and attachment handling. Mailtrap converts every incoming message into a predictable JSON payload your backend can consume immediately – sender, recipients, subject, headers, plain text, HTML body, and attachment download URLs, all in one structured object.
Hi team!
We were charged twice on invoice #4821 last week. Could you take a look and refund the duplicate? Screenshot attached.
Best regards,
Sarah
{"id": "1700000000000123","inbox_id": 12345,"from": "sarah@acme.co","to": ["support-bot-1a2b3c4d@inbound-mailtrap.io"],"cc": ["trev@acme.co","sophie@acme.co","brian@acme.co"],"bcc": [],"reply_to": null,"subject": "Need help with our last invoice","rfc_message_id": "<abc@acme.co>","in_reply_to": null,"references": [],"headers": {"mime-version": "1.0","return-path": "<sarah@acme.co>"},"size": 258048,"html_size": 198,"text_size": 150,"received_at": "2026-05-27T10:42:11.000Z","thread_id": "1700000000000124","attachments": [{"attachment_id": "att-1","size": 188416,"filename": "invoice-4873.png","content_type": "image/png","content_disposition": "attachment","content_id": null,"download_url": "https://s3.amazonaws.com/inbound-mail/att-1?X-Amz-Signature=...","download_url_expires_at": "2026-05-27T11:42:11.000Z"}],"raw_message_url": "https://s3.amazonaws.com/inbound-mail/raw.eml?X-Amz-Signature=...","raw_message_expires_at": "2026-05-27T11:42:11.000Z","html_body": "<html><body><p>Hi team!</p><p>We were charged twice on invoice #4873 last week. Could you take a look and refund the duplicate? Screenshot attached.</p><p>Best regards,</p><p>Sarah</p></body></html>","text_body": "Hi team!\n\nWe were charged twice on invoice #4873 last week. Could you take a look and refund the duplicate? Screenshot attached.\n\nBest regards,\n\nSarah"}
Clean REST endpoints with typed SDKs, so your agent can create inboxes, receive, parse, and reply to incoming messages in a few lines of code.
Everything your agent needs to receive, process, and reply to email.
Add Mailtrap to Claude, Cursor, VS Code, and any MCP-compatible client. Your agent creates inboxes, reads inbound messages, replies in-thread, and manages webhooks through natural-language tool calls.
Create and delete inboxes through the API for each agent, workflow, or environment – persistent or disposable, on a Mailtrap-hosted address or your own custom domain.
Get notified the second an email lands. The webhook delivers event IDs and key metadata; your agent fetches the full parsed message from the Messages API. No polling, no Gmail OAuth, no mail server to operate.
Every message you fetch from the Messages API is structured JSON: sender, recipients, subject, headers, plain text, HTML, and metadata – with no parsing library to maintain.
Files arrive as links on the parsed message, so your agent grabs only what it needs and keeps its context window lean.
Mailtrap groups replies into a single conversation, so your agent fetches the full thread and the context that comes with it – not scattered one-off messages.
Catch your agent’s replies in Email Sandbox during development, so no real customer gets a bad draft.
Whether you're building AI agents, internal tools, or automation pipelines, Mailtrap helps you receive, process, and reply to email through a single API.
Easily connect Mailtrap to the tools you use and keep everything running smoothly.
Call the Mailtrap API to create an inbox, then register a webhook URL where your agent gets notified when new mail arrives. Start on a Mailtrap-hosted address with no MX records, no DNS, and no mail server to set up, or connect your own custom domain when you’re ready for production. The moment an email lands, your agent gets a webhook notification and can fetch the fully parsed message from the Messages API. Create or delete inboxes programmatically for each agent, project, or session.
OAuth into a personal Gmail account hands your agent someone’s entire mailbox, with all the privacy, scope, and security questions that it brings, and it breaks the moment a token is revoked. A dedicated agent inbox is isolated, scoped to addresses you control, and provisioned per agent or project. Your agent only ever sees emails meant for it, and you can spin inboxes up or tear them down without touching anyone’s personal account.
Yes. When someone replies, Mailtrap groups the related messages into one conversation, so your agent can pull the full conversation history instead of stitching messages together itself. That gives it the context of the whole back-and-forth, which helps with follow-ups, support exchanges, and keeping agent memory in step with the conversation.
No, not to get started. A Mailtrap-hosted inbox works the moment you create it, with nothing to add in DNS and no MX records to configure. When you’re ready for production, connect your own custom domain and keep the same API and webhooks. Replies go out the same way in both cases, with a single API call.
Yes. During development, send your agent’s replies to Email Sandbox instead of real recipients and check the content and formatting before going live. To test incoming mail, create a separate dev inbox and send test emails to it.
Yes. Replying is part of the same API, so your agent answers in-thread with a single API call and the conversation flows both ways. On a Mailtrap-hosted inbox, replies are capped at 20 in total; connect your own custom domain and that limit goes away.