Skip to content

Cloudflare Email Service

Send transactional emails and route incoming emails to Workers or email addresses

Cloudflare Email Service provides powerful email capabilities:

  • Email Sending Beta for outbound transactional emails
    Available on Workers Paid plan
  • Email Routing for handling incoming emails with Workers or routing to email addresses
    Available on Free and Paid plans

Together, these two features make it possible for you to send and receive emails from your applications. For example, you can use Email Service for:

  • Transactional emails (welcome messages, password resets, order confirmations)
  • Authentication flows (magic links, email verification, two-factor authentication)
  • Notifications and alerts
  • Custom email addresses (support@, contact@, orders@)
  • Emails as a mode of interaction for agents, such as send an email to create an issue in ticket tracking

Access Email Service directly from Cloudflare Workers using bindings, from any platform using the REST API, or over authenticated SMTP:

Send emails with the EMAIL binding and handle incoming emails with the email() handler in src/index.ts:

TypeScript
interface Env {
EMAIL: SendEmail;
}
export default {
// Handle HTTP requests (Email Sending)
async fetch(request, env, ctx): Promise<Response> {
// Send a welcome email
await env.EMAIL.send({
to: "user@example.com",
from: "welcome@yourdomain.com",
subject: "Welcome to our service!",
html: "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
text: "Welcome! Thanks for signing up.",
});
return new Response("Email sent successfully");
},
// Handle incoming emails (Email Routing)
async email(message, env, ctx): Promise<void> {
// Forward to support team
if (message.to.includes("support@yourdomain.com")) {
await message.forward("team@yourdomain.com");
}
// Send auto-reply
await env.EMAIL.send({
to: message.from,
from: "noreply@yourdomain.com",
subject: "We received your message",
html: "<h1>Thank you!</h1><p>We'll get back to you soon.</p>",
});
},
} satisfies ExportedHandler<Env>;

Add the bindings to your Wrangler configuration file:

JSONC
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "<ENTER_WORKER_NAME>",
"main": "src/index.ts",
"compatibility_date": "$today",
// Email sending
"send_email": [
{
"name": "EMAIL"
}
],
// Email routing
"email": [
{
"name": "EMAIL_HANDLER"
}
]
}

See the full API reference for the REST API, Workers binding, and SMTP.

Get started

Features

Email Sending

Send transactional emails with high deliverability and global performance.

Use Email Sending

Email Routing

Route incoming emails to custom addresses, Workers, or external destinations.

Use Email Routing

Deliverability

Automatic IP reputation management and deliverability optimization.

Use Deliverability

Analytics & Observability

Monitor email performance with comprehensive metrics and alerting.

Use Analytics & Observability

API

Send and route emails using the REST API, Workers binding, or SMTP.

Use API

Workers

Build serverless applications that can send emails directly from the edge.

Queues

Process email events asynchronously with Workers Queues integration.

Analytics Engine

Store and analyze custom email metrics with Workers Analytics Engine.


More resources

Pricing

Understand Email Service pricing and plans.

Examples

Explore practical examples and implementation patterns.

Discord

Ask questions and discuss Email Service with other developers.

Twitter

Follow product announcements and developer updates.