How to Send Emails from Codex
Codex CLI is a capable coding agent, but its actions are limited to what it can do locally. It can’t send email. If you want Codex to notify someone when a task is done, or send a summary of what it found, you’d normally have to do that yourself. AgentPatch adds a send-email capability that Codex can use directly.
Why This Matters
Sending email is often the last mile of an automated task. You run a script, analyze some output, make a decision — and then someone needs to know the result. Without email, you’re still the one who has to pick up that step.
With AgentPatch’s Email tool connected to Codex, your agent can close that loop. It can draft a message using context from the session and send it, all in one step. No SMTP setup, no third-party accounts, no environment variables to configure.
Setup
Add AgentPatch to ~/.codex/config.toml:
[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"
Then set your API key:
export AGENTPATCH_API_KEY=your_api_key
Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.
Example
You’re doing a code quality check and want to share the results with your team:
“Analyze the codebase for common issues, then send a summary to [email protected] with your findings organized by severity.”
Codex runs the analysis, composes the findings, and sends the email through AgentPatch. Your engineering team gets a structured summary without you writing a single line of the message yourself.
For deployment notifications:
“Check the deployment status and send me an email at [email protected] confirming whether the latest version is running.”
Codex checks what it can access and sends you the confirmation. A simple status email, handled entirely by the agent.
You can also use it for follow-ups after longer sessions:
“Summarize what we worked on today and send the recap to [email protected].”
Codex writes the recap from session context and sends it. No copy-pasting, no switching apps.
Wrapping Up
The email tool is one of many available once AgentPatch is connected. You also get YouTube transcripts, web search, image generation, and more — all through the same MCP config. Visit agentpatch.ai to explore what’s available.