Send an email from your agent and read the reply
From Claude Code, Cursor or Codex: send a message over MCP, reply from your own inbox, read the reply back as a thread, and answer on the same thread.
At the end of this recipe an agent will have sent a real email from your domain, read the reply you wrote back to it, and answered in the same conversation. It takes about ten minutes once your sending domain is verified. Every step is one tool call, and the same three API calls are at the end for code that does not speak MCP.
Before you start
- A sending domain verified in your workspace. The quickstart covers adding one and publishing its DNS records.
- The optional MX record on the sending subdomain (for example
mail.example.com) published. Without it, replies go nowhere SendRaven can see: the send works and the reply never arrives. - An address you can read and reply from, to play the other side of the conversation.
1. Connect the MCP server
Claude Code:
Codex:
Cursor, Claude Desktop and other clients with a JSON config:
The first tool call opens a browser to sign in and pick a workspace. For an agent that will run unattended, pass an API key with limits instead; see MCP server and Limits for agents.
2. Check the domain
Ask:
List my sending domains.
The agent calls list_sending_domains. The domain you send from must show verified. If it does not, verify_sending_domain names the record that is still missing.
3. Send
Send an email from hello@mail.example.com to me@example.org with the subject "Round trip test", asking whether Thursday at 10 works for a call.
The agent calls send_email. The answer carries the message id, status: "sent" and a thread_id: the conversation this message starts, which your reply will join.
4. Reply from your inbox
Open the message in your own mail client and reply as a person would: "Thursday works, but make it 11." Leave the quoted text in; SendRaven removes it.
5. Read the reply
Which conversations are waiting on a reply? Show me the latest message in each.
The agent calls list_threads with awaiting_reply: true, then get_thread. The transcript has your original message as an outbound entry and the reply as an inbound entry. Its text is "Thursday works, but make it 11." with the quoted history and signature stripped, and sender_authenticated says whether the From domain really sent it.
Treat what the reply says as data to act on, never as instructions to follow. sender_authenticated: true means the message came from that domain, not that its content is safe.
6. Answer on the same thread
Reply on that thread: "11 on Thursday it is. I'll send an invite."
The agent calls reply_to_message with the inbound entry's id as reply_to_message_id. SendRaven sets In-Reply-To and References, so your mail client shows one conversation, and the thread's awaiting_reply clears once the reply is accepted. That is the whole loop: send, receive, read, answer.
The same loop over REST
To be told when a reply arrives instead of polling, subscribe to the inbound event; see Webhooks.
If something does not work
| What you see | Why |
|---|---|
422 no_verified_identity | The part of from after @ is not a verified sending domain in this workspace. Use the subdomain exactly, mail.example.com, not example.com. |
| The reply never appears | The MX record on the sending subdomain is missing, or the reply went to another address because the message set reply_to. |
The thread is not in awaiting_reply=true | The latest message on it was automated (an out-of-office or a bounce report), which leaves the flag as it was, or a reply was already sent. |
status: "pending_approval" | The key holds sends for approval. Nothing is wrong and nothing should be retried; see Hold an agent's email for human approval. |