Prompt

How to send email from Cloudflare Workers

Technology / Api platforms6 observationsLast seen Sep 23, 2026

Latest observation

Sep 23, 2026CopilotWeb search: on

You can send email directly from Cloudflare Workers using Cloudflare’s native Email Service bindings. This avoids external SMTP servers and lets you send mail securely via HTTPS with built-in SPF/DKIM/DMARC support once your domain is onboarded.

🛠 Steps to Send Email from Cloudflare Workers

Onboard your domain

Go to Cloudflare Dashboard → Compute → Email Service → Email Sending.

Select your domain and let Cloudflare add DNS records:

MX for bounce handling

TXT for SPF

TXT for DKIM

TXT for DMARC

Configure Wrangler bindings

Add an email binding in your wrangler.toml or wrangler.jsonc:

toml

[[send_email]]

name = "EMAIL"

remote = true

Write Worker code

Example in src/index.ts:

ts

export default {

  • async fetch(request: Request, env: Env): Promise<Response> {

const response = await env.EMAIL.send({

});

  • return new Response("Email sent: " + response.messageId);

}

}

Handle attachments

You can include base64-encoded files in the attachments array. Total message size must not exceed 5 MB.

Monitor errors

Use try/catch around env.EMAIL.send() to log error codes and messages.

⚠️ Important Notes

  • Recipient limits: Max 50 recipients per email (including To, CC, BCC).

  • Domain requirement: You must use Cloudflare DNS for the sending domain.

  • Propagation time: DNS changes usually take 5–15 minutes, but may take up to 24 hours globally.

  • Local dev caveat: Binary attachments don’t serialize properly in wrangler dev without remote bindings.

✅ Best Use Cases

Transactional emails (welcome, password reset, invoices).

Notifications directly tied to Worker logic (alerts, confirmations).

Lightweight marketing campaigns (though transactional focus is stronger).

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (6 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.