Tutorials

14 posts on tutorials for AI agents that send and receive email.

Fixtures replayed, with actions asserted rather than wording

6 August 2026 · 3 min read

A test suite for an agent that writes email

How to write the golden thread harness in code: fixtures, assertions on actions rather than wording, a fake mail client, and the adversarial cases worth pinning.

One bad reply, and the trail back to its cause

6 August 2026 · 4 min read

It sent the wrong thing. Now what

A wrong reply has five common causes and each leaves a different trace. How to find which one it was, in order, without reading message bodies out of a log.

Typed tools bound to a model call, with the inbox behind them

4 August 2026 · 3 min read

Email tools for an agent built with the Vercel AI SDK

Define email as typed tools, keep the loop bounded, and put the untrusted message where it cannot reach a privileged call. A working shape with the parts that matter explained.

One HTTP API reached from several languages

4 August 2026 · 3 min read

No SDK for your language, and it does not matter

The whole surface is an HTTP API with a bearer token. What the four calls look like in Go, Ruby, and PHP, and the three things to get right whatever you write it in.

A hosted client authorising against a workspace rather than holding a key

3 August 2026 · 4 min read

Connecting a hosted client that cannot hold a key

Some clients cannot store an API key, so they authorize as you instead. How the OAuth flow works, what the scopes cover, why a token needs an agent header, and when to prefer a key.

A Node service receiving a webhook, queueing, and replying

3 August 2026 · 4 min read

Running an email agent on ordinary Node infrastructure

Not everything runs on the edge. The same agent as a Node service: webhook endpoint, a queue, per-thread locking in Postgres, and the deployment details that decide whether it survives a burst.

A webhook trigger, an LLM step, and an HTTP call replying in thread

1 August 2026 · 4 min read

An email agent without writing a service

Wire an inbox to an automation tool: receive with a webhook, decide with an LLM step, reply through one HTTP call, and the four things to get right so it does not double-send.

A graph with an email node reading a thread and replying

1 August 2026 · 4 min read

Adding email to a LangChain or LangGraph agent

Wire an inbox into a LangChain or LangGraph agent: MCP where the adapter exists, plain tools where it does not, and where the email work belongs in a graph.

A TypeScript agent sending and receiving from its own address

30 July 2026 · 3 min read

An email agent in TypeScript, from empty folder to first reply

A working TypeScript agent with its own inbox: install, send, read the thread, wait for a reply, handle refusals, and receive inbound mail without a polling loop.

A GPT-based agent connected to an email tool surface

30 July 2026 · 4 min read

Giving an OpenAI-based agent an email address

Connect a GPT-based agent to a real inbox: MCP where the tooling supports it, plain function tools where it does not, and the guardrails to set before it emails anyone.

An agent's mailbox listed from a terminal

30 July 2026 · 4 min read

Driving an agent's inbox from the terminal

The CLI is the fastest way to see what an agent is doing: list its mail, read a thread, send a test message, and script the checks worth running in CI.

A Python agent sending and receiving mail from its own address

27 July 2026 · 4 min read

Sending and receiving email from a Python agent

A working Python agent with its own inbox: install the SDK, send a first message, read threads, wait for replies, handle refusals, and receive inbound mail without a polling loop.

An agent running as a Durable Object, connected to an MCP email server

27 July 2026 · 4 min read

Build an email agent on the Cloudflare Agents SDK

A working email agent as a Durable Object: connect the MCP server, react to inbound mail through a webhook, hold a thread across days, and keep the whole thing idempotent.

Claude calling send_email and receiving a message id back

25 July 2026 · 5 min read

How to let Claude send and receive email

Connect Claude to a real inbox in a few minutes with an MCP email server: config, the first send, holding a conversation, and the limits worth knowing before you let a model email people.