
In this article, I will explain the appeal and infinite possibilities of the newly announced "Cloudflare Email Service" from Cloudflare, while providing some technical insights in an easy-to-understand way!
When developing applications, sending and receiving emails is an unavoidable path, isn't it? But have you ever felt like this?
"I just want to send a confirmation email for user registration, but managing API keys for external services is a hassle..."
"I can write the receiving logic in Cloudflare Workers, but it feels inconsistent to have to install a separate SDK for sending..."
"Tracking whether emails are actually delivered is also a huge struggle..."
This Cloudflare Email Service is what shines a light on such developer frustrations!
Note: This service is a foundation for developers specialized in sending notification emails (transactional emails) from applications and processing received emails programmatically. Please note that it does not provide general mailbox features (IMAP/POP) like Gmail.
Also, the Email Sending feature is currently in private beta and is scheduled to be available around November 2025. Using it will require a paid Workers plan, and it is expected to be a pay-as-you-go model based on the number of emails sent (specific unit prices are yet to be determined).
How will our development experience change with the arrival of this service? I will introduce 3 revolutionary points!
1. Workers-native sending experience
Until now, it was standard practice to contract with an external Email Service Provider (ESP) to send emails, securely manage the issued API keys, and introduce a dedicated SDK. However, with this service, you can send emails just by adding a few lines of configuration to wrangler.jsonc and calling env.SEND_EMAIL.send() from your Workers code!
Thanks to a mechanism called "bindings," you no longer have to worry about the risk of leaking troublesome API keys. It's as if the email sending functionality has been there all along, naturally usable as part of Workers. This is a truly welcome change.
2. A world where everything connects with Cloudflare
The true value of this service lies in its ability to seamlessly integrate with other Cloudflare services.
Receive (Email Routing) → Analyze with AI (Workers AI) → ️ Save Data (R2) → Delegate Heavy Processing (Queues) → Auto-Reply (Email Sending)
This entire workflow is completed on a single stage: Cloudflare. There is no longer any need to jump between multiple external services. Like an orchestra, each service coordinates to play a beautiful harmony. That kind of integrated development experience is waiting for us.
3. A Strong Commitment to “Delivery”
It’s meaningless if the emails you send end up in the spam folder, right? Cloudflare has an extraordinary commitment to ensuring that emails reliably reach the recipient's inbox (deliverability) and to their speed (time-to-inbox).
It automatically handles settings like SPF/DKIM/DMARC—which act as “identity certificates” for emails—in coordination with Cloudflare DNS. Developers can achieve high delivery quality from the start without worrying about complex configurations.
(*To receive the maximum benefit of this, it is effectively a prerequisite that your domain is managed by Cloudflare DNS.)
4. An Operational Perspective That Cares for Developers ✨
Since you can thoroughly track events like “email was not delivered (bounced)” or “delivery completed successfully,” it becomes easier to pinpoint the cause if any issues arise. Furthermore, by using the wrangler command, you can simulate sending and receiving emails on your own PC, which significantly speeds up the cycle from development to debugging.
This magical experience is realized through a simple mechanism.
Sending (Email Sending)
Just call env.<binding name>.send(...) from your Workers code. It’s very simple! For the email body, you can use HTML generated by modern libraries like React Email as-is. In the future, REST API and SMTP interfaces are also planned to be provided so that you can easily send from external services as well.Receiving (Email Routing + Email Workers)
Just point your domain's MX records to Cloudflare and you're ready. After that, if you deploy a Worker with a special handler called async email(message, env, ctx), you can process received emails programmatically however you like.AI Utilization (Workers AI)
If you pass the body of a received email to Workers AI, you can classify the content, summarize it, or extract important keywords. By combining this, the possibilities are endless, such as automatically sorting customer support inquiries or determining the urgency of system alerts.
Now, let’s leave the theory behind and actually get our hands dirty! Here, I will use a dummy domain name like example.com for this shared article, but you should be able to get the feel for it.
1. Project Preparation
First, let's start with the standard project creation. Please make sure that Node.js is installed.
# wranglerの最新版をインストール npm install -g wrangler プロジェクト用のフォルダを作って、そこに移動します mkdir cf-email-demo && cd $_ npmプロジェクトを初期化 npm init -y
2. Wrangler Configuration (Sending Bindings)
Create a configuration file named wrangler.jsonc to let Workers know, "I'm going to use the email sending feature!"
File name: wrangler.jsonc
"name": "cf-email-service-demo", "main": "src/index.ts", "compatibility_date": "2025-09-25", // ここがキモ!メール送信用バインディングの設定です。 // "name"はコード内で使う変数名(env.SEND_EMAIL の部分)になります。 "send_email": [ "name": "SEND_EMAIL" ]
3. Minimal Sending Worker Code
Next, we will write the program that actually sends the email. Let's create a src folder and create an index.ts file inside it.
File name: src/index.ts
export default
async fetch(_req: Request, env: any)
// env.SEND_EMAIL.send() を呼び出すだけ!
await env.SEND_EMAIL.send(
to: [ email: "hello@example.com" ], // 宛先
from: email: "api-sender@example.com", name: "Your App" , // 送信元
subject: "Hello World", // 件名
text: "Hello World from Cloudflare Workers!" // 本文
);
return new Response("Email sent successfully!");
;Look at this simplicity! It's surprising, isn't it?
4. Let's Run It Locally (Send/Receive Emulation)
Once you're ready, just run this command.
wrangler dev
wrangler dev is a magic command that simulates sending and receiving emails on your PC. The emails don't actually fly out to the internet; instead, the sent emails are saved locally in .eml file format, and the location of those files is displayed in the console. This allows you to safely verify the operation before deploying!
For example, let's consider a scenario where you process notification emails from IoT sensors installed in your home garden.
The sensor sends an email saying "The soil is dry!" -> The Email Worker receives it -> AI determines "Watering is needed" -> The sensor status is recorded in R2 -> An automated reply email is sent to you saying "Your vegetables are thirsty!"
This entire sequence can be completed using only Workers.
File name: src/email-worker.ts
export default
async email(message: any, env: any) message.from;
// (おまけ) AIで件名をざっくり分類してみましょう!
const classification = await env.AI.run("@cf/huggingface/distilbert-sst-2-int8",
text: subject
);
// (おまけ) 受信したメールそのものをR2に保存しておくこともできます
// await env.R2_BUCKET.put(inbox/$Date.now().eml, message.raw);
// 自動返信メールを送信します
await env.SEND_EMAIL.send(
to: [ email: replyTo ],
from: email: "no-reply@your-domain.com", name: "菜園の見守りボット" ,
subject: Re: $subject,
text: メール受け付けました。AIによる分類結果: $classification.label ?? "N/A"
);
;To ensure your emails don't get sucked into the alternate dimension known as the spam folder, there are a few things you should keep in mind.
Establish Trust (Authentication): Cloudflare automatically sets up SPF/DKIM/DMARC for you, but the standard practice is to start your DMARC policy at p=none (monitoring mode) and gradually strengthen it to p=quarantine (send to spam) or p=reject (reject delivery).
Slow and Steady (Warm-up): Never send a large volume of emails from a new domain right away. The receiving server will get suspicious and flag you as a threat. Start small and set up a “warm-up” period where you gradually increase the number of emails sent.
Be Sincere (Content Optimization): In addition to HTML emails, always provide a plain text version. It is also wise to avoid overusing words that are easily mistaken for spam or suspicious URLs.
Process Quickly (Architectural Design): If there is heavy processing before sending an email, leave it to Cloudflare Queues. By completing the sending process itself immediately, you can reduce the time it takes for the email to reach the recipient's inbox.
Keep Your Ears Open (Feedback Loop): Monitor events such as bounces and successful deliveries, and have a system in place to respond immediately if something goes wrong.
The anxiety of “Is this actually working?” is part and parcel of system operations. Cloudflare Email Service comes with mechanisms to ease that worry.
Event Visualization: When a user asks, “Why didn't I get the email?”, you no longer need to panic. By checking the Cloudflare dashboard, it becomes immediately clear whether the email was delivered successfully or if it got lost along the way.
End-to-End Local Testing: With wrangler dev, you can test the entire flow from receiving an email to processing and replying on your own PC before deploying. This allows you to find bugs early and release to production with confidence.
Scenario 1: Confirmation Email During User Registration
This is the most common case!
A user signs up for your service.
The Worker creates user information in the database and issues a confirmation token.
Send a confirmation email containing a token using env.SEND_EMAIL.send()!
✅ The user clicks the link in the email, and registration is complete.
Scenario 2: Automated Customer Support Reception
You can also automate your inquiry desk.
A customer sends an inquiry email to support@your-domain.com.
Cloudflare's MX server receives the email and triggers the Email Worker.
If there are attachments, save them to R2 and link them to a ticket management system like Jira via API.
Send an automated reply email using env.SEND_EMAIL.send() saying, “We have received your inquiry. Your reference number is XX.”
Let's also talk about important security matters.
Goodbye to Credentials: Embedding API keys in your code is like hiding your house key under the doormat. It’s a bit unsettling, isn't it? But with the binding method, Cloudflare manages your authentication credentials securely, so you no longer have to worry about where to hide your keys!
Working with AI: When processing data that may contain private information, such as the body of received emails, using AI, you need to be careful with how you handle it. It is important to take precautions such as not leaving unnecessary logs, selecting appropriate models, and clearly defining data retention periods.
Leave Footprints (Audit Trails): Properly maintaining records (event logs) of “who sent what content to whom and when” is also important from a compliance perspective.
This service has just begun. There are still parts that remain veiled.
Pricing: We know that billing will be based on the number of emails sent, but specific unit prices and free tiers have not yet been announced. A paid Workers plan subscription is required.
API Specifications: We are waiting for future documentation updates regarding detailed specifications for the REST API and SMTP interface, as well as the Webhook schema for event notifications.
Sending Limits: During the beta phase, there may be limits on the number and speed of emails that can be sent at once. Operational policies for full-scale high-volume sending are also expected to be released in the future.
This announcement has become a major topic in the international developer community as well.
Welcoming voices : There were many enthusiastic welcoming comments, such as “Finally, email can be completed within the Workers ecosystem!” and “It’s great to be freed from managing SendGrid or Amazon SES.”
Cautious opinions : On the other hand, there were also more level-headed opinions, such as “Email deliverability is all about track record. Can Cloudflare be trusted?”, “What will the pricing be like?”, and “It’s a bit scary to be too dependent on a single vendor.”
Clarifying the understanding : The consensus that “this is not a replacement for Gmail, but a sending layer for developers like SendGrid/SES” was shared, and many people were convinced.
Q1. I thought the existing Email Routing already had a feature to send emails...?
A. Yes, that’s a great question! The previous functionality was mainly focused on “forwarding received emails to specific verified addresses.” This Email Sending (beta) is positioned as a first-class sending feature for delivering full-scale transactional emails from your application to an unspecified number of recipients.
Q2. Can I use template engines like React Email?
A. Of course! You can generate HTML with React Email or similar tools, and simply pass the result as a string to the html property of the send() method to send beautiful HTML emails.
Q3. Can I test the entire flow of receiving, processing, and replying to emails in a local environment?
A. Yes, you can! By using the send/receive emulation feature of wrangler dev, you can complete and test the entire process on your own PC.
Q4. When can I start using it?
A. The private beta for Email Sending is scheduled to begin in November 2025. You can sign up for the waitlist on the official website, so if you are interested, please check it out!
Cloudflare Email Service is not just an addition of an email sending feature. It holds the potential to fundamentally change the way we think about the email experience in applications.
Focus on Business Logic: Since Cloudflare absorbs the complex parts of email operations, we can devote more time to creating value for our products.
Security by Design: With an API-key-free design and automatic integration with DNS, a high level of security is ensured from the start.
️ A Consistent and Superior Developer Experience: Everything from receiving to AI processing, storage, and sending can be completed in a single environment called Workers. This is a supreme joy for developers.
Rapid Prototyping: Thanks to Wrangler's powerful local emulation features, the cycle of shaping, verifying, and improving ideas will run faster than ever before.
Although it is still in beta, this new wave will undoubtedly lead our development style to become better and more creative.
Why not start by exploring the possibilities of receiving processes with existing Email Routing, while registering for the Email Sending (beta) waitlist to prepare for the arrival of a new era?
Author Profile
I am @kyutaro15, and I explain AI technology. I share the latest AI/cloud trends in an easy-to-understand way from a field perspective.
Reference Links
Official Blog: Announcing Cloudflare Email Service’s private beta
Cloudflare Workers / Email Workers / Wrangler Documentation
If you could give me a "like" or a "comment," it would be a great encouragement for my next article! Also, if you have any questions or things you want to know more about, please feel free to comment.