OpenAICloudflareApr 16, 2026, 6:00 AM

Cloudflare Email Service: now in public beta. Ready for your agents

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Cloudflare Email Service: now in public beta. Ready for your agents

Key Points

  • Email Sending now in public beta
  • Native Workers binding + SDKs for sending
  • Agents SDK supports async stateful email agents

Summary

Cloudflare Email Service enters public beta for Email Sending, completing a bidirectional email platform with Email Routing and Agents SDK. Engineers can now send authenticated transactional email directly from Workers (native binding), via REST API, or with TypeScript/Python/Go SDKs — without managing credentials. The platform also adds integrations (MCP server, Wrangler CLI, Email Skill) and an open-source Agentic Inbox reference to build stateful, asynchronous email-native agents.

Key Points

  • Email Sending is public beta: native Workers binding (env.EMAIL.send) and REST/SDK access for transactional mail.
  • No manual DNS pain: when you add a domain, Cloudflare configures SPF/DKIM/DMARC for authenticated delivery and low-latency global delivery.
  • Agents SDK: onEmail hook supports asynchronous, stateful agents (Durable Objects) that can persist conversation state, run long tasks, and reply later.
  • Secure reply routing: HMAC-SHA256-signed routing headers let replies route back to the exact agent instance and prevent header forgery.
  • External-agent integrations: Email endpoints exposed via the Cloudflare MCP server and Wrangler CLI so agents running outside Workers can send email with minimal context overhead.
  • Tooling and references: Cloudflare Email Skill documents best practices; Agentic Inbox is an open-source reference app (inbound routing, attachments via R2, Workers AI classification).

Practical action items for engineers

  • Try Email Sending in the Cloudflare Dashboard and follow the Email Service docs.
  • Use the Workers binding (env.EMAIL.send({...})) for serverless outbound mail or the REST API/SDKs for other runtimes.
  • Wire Email Routing to your Workers to receive email, persist state in Durable Objects, and reply asynchronously from your agent logic.
  • Use the MCP server or Wrangler CLI when building agents that operate outside Cloudflare, and fork Agentic Inbox as a starting point for inbox+agent workflows.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Cloudflare Email Service:パブリックベータ公開 — エージェント対応

Cloudflare Email Service:パブリックベータ公開 — エージェント対応

Emailは世界で最もアクセスしやすいインターフェースです。普遍的で、カスタムチャットアプリや各チャネルごとの専用SDKは不要です。誰もが既にメールアドレスを持っているため、誰でもあなたのアプリケーションやエージェントとやり取りできます。エージェント側も誰とでもやり取りできます。

アプリケーションを構築しているなら、サインアップ、通知、請求書送付などですでにEmailに依存しているはずです。最近では、アプリケーションのロジックだけでなく、エージェントもこのチャネルを必要としています。プライベートベータ中に我々は、まさにこれを構築している開発者たち(カスタマーサポートエージェント、請求書処理パイプライン、アカウント検証フロー、マルチエージェントワークフローなど)と話しました。パターンは明白です:Emailはエージェントにとってコアなインターフェースになりつつあり、開発者はそれ向けに作られたインフラを必要としています。

Cloudflare Email Serviceはその答えです。

  • Email Routingでアプリケーションやエージェントがメールを受信できます。
  • Email Sendingでメールに返信したり、エージェントの作業完了をユーザーに通知できます。
  • 開発者プラットフォームの他機能と組み合わせれば、完全なメールクライアントやAgents SDKベースのメールネイティブ機能(onEmail hook)を構築できます。

本日(Agents Weekの一部として)、Cloudflare Email Serviceはパブリックベータに移行しました。これにより、任意のアプリケーション/エージェントがメールを送信できるようになります。また、メールネイティブなエージェントを作るためのツールキットも完成します:

  • Email Sending binding(WorkersとAgents SDKから利用可能)
  • 新しい Email MCP server
  • Wrangler CLI の email コマンド
  • エージェントをコーディングするためのSkills
  • オープンソースの Agentic Inbox リファレンスアプリ

Email Sending:パブリックベータへ

Email Sending は本日プライベートベータからパブリックベータに移行しました。ネイティブな Workers バインディングを使えば、Workers からトランザクショナルメールを直接送れます — APIキーやシークレット管理は不要です。

export default {
  async fetch(request, env, ctx) {
    await env.EMAIL.send({
      to: "[email protected]",
      from: "[email protected]",
      subject: "Your order has shipped",
      text: "Your order #1234 has shipped and is on its way."
    });
    return new Response("Email sent");
  },
};

または、任意のプラットフォーム/言語からREST APIやTypeScript、Python、GoのSDKを使って送信できます:

curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/email-service/send" \
  --header "Authorization: Bearer <API_TOKEN>" \
  --header "Content-Type: application/json" \
  --data '{ "to": "[email protected]", "from": "[email protected]", "subject": "Your order has shipped", "text": "Your order #1234 has shipped and is on its way." }'

実際に受信トレイへ届くメールを送るには、SPF、DKIM、DMARC等の設定に対処する必要があります。ドメインを Email Service に追加すると、これらはすべて自動で設定されます。メールは認証され配信され、迷惑メール扱いされにくくなります。さらに、Email Service は Cloudflare のグローバルネットワーク上のサービスなので、世界中どこでも低いレイテンシで配信されます。

長年無料で提供している Email Routing と組み合わせれば、単一プラットフォームで双方向のメールフローを実現できます。メールを受信し、Workerで処理し、返信する——すべてCloudflare内で完結します。

詳細は Birthday Week の発表をご参照ください。

Agents SDK:エージェントをメールネイティブに

Cloudflare の Agents SDK には、既に受信メールを処理するためのファーストクラスな onEmail フックがあります。しかしこれまでは、エージェントは同期的にしか返信できなかったり、Cloudflareアカウント内のメンバーにしかメールを送れないといった制約がありました。Email Sending により、その制約は解消されます。

これがチャットボットとエージェントの違いです。メールエージェントはメッセージを受け取り、プラットフォーム全体で作業をオーケストレーションし、非同期に応答できます。チャットボットはその場で応答するか、応答しないかのいずれかになりがちです。エージェントは考え、行動し、独自のタイムラインでコミュニケーションできます。

Email Sending を得たエージェントは、メッセージを受け取り、1時間かけてデータ処理や外部システムの確認を行い、完全な回答を返信できます。フォローアップのスケジュールや、エッジケース検出時のエスカレーションも可能です。つまり、単に質問に答えるだけでなく、本当に作業を遂行できます。

以下は、受信・永続化・返信のフルパイプラインを示すサンプルです:

import { Agent, routeAgentEmail } from "agents";
import { createAddressBasedEmailResolver, type AgentEmail } from "agents/email";
import PostalMime from "postal-mime";

export class SupportAgent extends Agent {
  async onEmail(email: AgentEmail) {
    const raw = await email.getRaw();
    const parsed = await PostalMime.parse(raw);
    // Persist in agent state
    this.setState({
      ...this.state,
      ticket: {
        from: email.from,
        subject: parsed.subject,
        body: parsed.text,
        messageId: parsed.messageId
      },
    });

    // Kick off long running background agent task
    // Or place a message on a Queue to be handled by another Worker

    // Reply here or in other Worker handler, like a Queue handler
    await this.sendEmail({
      binding: this.env.EMAIL,
      fromName: "Support Agent",
      from: "[email protected]",
      to: this.state.ticket.from,
      inReplyTo: this.state.ticket.messageId,
      subject: `Re: ${this.state.ticket.subject}`,
      text: `Thanks for reaching out. We received your message about "${this.state.ticket.subject}" and will follow up shortly.`
    });
  }
}

export default {
  async email(message, env) {
    await routeAgentEmail(message, env, {
      resolver: createAddressBasedEmailResolver("SupportAgent"),
    });
  },
} satisfies ExportedHandler<Env>;

エージェントSDKのメール機能が内部でどう動作しているかを簡単に説明します。

  • 各エージェントは単一ドメインから固有のアイデンティティを得ます。
  • アドレスベースのリゾルバは [email protected] を "support" インスタンスに、[email protected] を "sales" インスタンスにルーティングします。
  • 個別の受信箱をプロビジョニングする必要はありません。ルーティングはアドレスに組み込まれています。
  • サブアドレッシング([email protected])を使って別のエージェントネームスペースやインスタンスへルートすることも可能です。
  • Stateはメール間で永続します。エージェントは Durable Objects によってバックアップされており、this.setState() を呼べば会話履歴や連絡先、コンテキストをセッション間で保持できます。受信箱がエージェントのメモリになり、別途データベースやベクターストアを用意する必要がありません。
  • セキュアな返信ルーティングが組み込まれています。エージェントがメールを送り返信を期待する場合、ルーティングヘッダを HMAC-SHA256 で署名して、返信が元のエージェントインスタンスへ正確に戻るようにできます。これによりヘッダを偽造して任意のインスタンスへメールをルーティングする攻撃を防げます。

受信、解析、分類、状態永続化、非同期ワークフロー起動、返信/エスカレーション——これらすべてを単一の Agent クラス内で実行し、Cloudflare のグローバルネットワーク上にデプロイできます。多くのチームが他でスクラッチから構築している完全なメールエージェントパイプラインがここにあります。

エージェント向けのメールツール:MCP server、Wrangler CLI、Skills

Email Service は Cloudflare 上で動くエージェント向けだけではありません。Claude Code、Cursor、Copilot のようなローカルで動くコーディングエージェントでも、コンテナや外部クラウドで動くプロダクションエージェントでも、どこからでもメールを送信する必要があります。そこで、どこで動いていても Email Service を使えるようにする3つの統合を公開します。

  • Email は Cloudflare MCP server 経由でも利用可能です。Code Mode を動力にしたこのサーバは、エージェントに Cloudflare API 全体へのアクセスを与えます。MCP server を使えば、エージェントは Email エンドポイントを発見して呼び出し、メールの送信や設定ができます。たとえばプロンプトで以下のように指示できます:

    • "Send me a notification email at [email protected] from my staging domain when the build completes"
  • Wrangler CLI は、ローカルやサンドボックスで bash アクセスがあるエージェント向けに MCP のコンテキストウィンドウ問題を解決します。ツール定義が数万トークンを消費する代わりに、Wrangler によってエージェントはほぼゼロのコンテキストオーバーヘッドで機能をオンデマンドに発見できます。Wrangler を使ったメール送信例:

    wrangler email send
    --to "[email protected]"
    --from "[email protected]"
    --subject "Build completed"
    --text "The build passed. Deployed to staging."

  • Skills: Cloudflare Email Service の Skill を公開しています。これを使えば、Workers バインディングの設定、REST API や SDK 経由での送信、Email Routing による受信処理、Agents SDK を用いた構築、Wrangler CLI や MCP による管理など、エージェント向けの完全なガイダンスが提供されます。配信性(deliverability)のベストプラクティスや、迷惑メールにならないトランザクショナルメールの作り方も含まれます。プロジェクトに導入すれば、コーディングエージェントは Cloudflare 上での本番対応メールを構築するために必要なすべてを手に入れます。

メールエージェント向けツールのオープンソース化

プライベートベータ期間中に我々はメールエージェントの実験も行いました。その中で、エージェントが送るメールを人間がレビューして操作できる仕組みがしばしば必要になることが明らかになりました。最良の方法は、エージェント自動化が組み込まれたフル機能のメールクライアントです。

そこで作ったのが Agentic Inbox です。会話のスレッド表示、メールレンダリング、メールと添付の受信・保存、自動返信などを備えたリファレンスアプリケーションです。外部エージェントがドラフトを作成し、人が確認した後に agentic-inbox から送信するための専用 MCP server も内蔵されています。

Agentic Inbox はオープンソースで公開します。これは Email Routing(受信)、Email Sending(送信)、Workers AI(分類)、R2(添付)、Agents SDK(ステートフルロジック)を組み合わせてフルなメールアプリケーションを作る方法のリファレンスです。ワンクリックでフル機能の受信箱・メールクライアント・エージェントをデプロイできます。

我々はメールエージェント向けツールを組み合わせ可能かつ再利用可能にしたいと考えています。各チームが同じ受信→分類→返信のパイプラインを再構築するのではなく、このリファレンスアプリから始めてフォークし、拡張してワークフローに合うエージェントを作ってください。

今すぐ試す

Emailは世界で最も重要なワークフローが存在する場所ですが、エージェントにとってはこれまで到達しにくいチャネルでした。Email Sending がパブリックベータになったことで、Cloudflare Email Service は双方向コミュニケーションの完全なプラットフォームとなり、受信箱をエージェントのファーストクラスなインターフェースにします。

  • Cloudflare Dashboard で Email Sending を試す
  • Email Service ドキュメントを読む
  • Agents SDK のメールドキュメントを確認する
  • Email Service MCP server と Skills をチェックする
  • オープンソースのリファレンスアプリをデプロイする
  • Cloudflare TV で関連動画を視聴する

Cloudflare の接続クラウドは企業ネットワーク全体を保護し、顧客がインターネット規模のアプリケーションを効率的に構築するのを支援します。