Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Inspect Email Workers with Local Explorer
description: Inspect locally routed and sent email, and deliver test messages to Email Workers from Local Explorer.
products:
- workers
date: 2026-08-24
---

Local Explorer now includes **Routing** and **Sending** views for Email Workers during local development.

The **Routing** view captures messages delivered to an `email()` handler. You can inspect message content, headers, attachments, replies, forwarding, rejection, and other handler activity. The test email composer can deliver custom text, HTML, headers, and attachments directly to the handler.

![Local Explorer Routing detail showing a received email that was forwarded and replied to](~/assets/images/email-service/local-explorer-email-routing-detail.png)

The **Sending** view captures messages sent through simulated local `send_email` bindings. You can inspect the recipients, headers, attachments, and body for each message.

![Local Explorer Sending view showing a sent email list and selected message detail](~/assets/images/email-service/local-explorer-email-sending-detail.png)

Run `wrangler dev` and press `e` to open Local Explorer.

For configuration and usage details, refer to the [Local Explorer documentation](/workers/local-development/local-explorer/) and [Email Service local development documentation](/email-service/local-development/).
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ Start your development server:
npx wrangler dev
```

Send a test email using the local endpoint. The request body must be a raw email message in [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) format, and the message must include a `Message-ID` header:
To test through Local Explorer, press `e` in the `wrangler dev` terminal. In Local Explorer, go to **Email** > **Routing** and select **Send Test Email**. Compose the message, then select **Send Email**. Local Explorer delivers the message to the selected Worker `email()` handler.

The **Routing** view lists messages delivered during the local session. Select a message to inspect its headers, body, attachments, and handler actions.

You can also send a test email using the local endpoint. The request body must be a raw email message in [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322) format, and the message must include a `Message-ID` header:

```bash
curl --request POST 'http://localhost:8787/cdn-cgi/local/email' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ Remote bindings send real emails to real recipients. Use test email addresses to

When running `wrangler dev` without remote bindings, the email binding is simulated locally. Emails are not sent -- instead, the email content is logged to the console and saved to local files for inspection.

Local Explorer also captures these messages. Press `e` in the `wrangler dev` terminal, then go to **Email** > **Sending**. Select a message to inspect its recipients, headers, attachments, and captured body.

## Basic sending worker

```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ Local Explorer supports the following binding types:
| [R2](/r2/) | List objects, view metadata | Upload and delete objects |
| [D1](/d1/) | Browse tables and rows, run SQL queries | Insert, update, and delete rows through SQL |
| [Durable Objects](/durable-objects/) (SQLite storage) | Browse SQLite tables and rows, run SQL queries | Insert, update, and delete rows through SQL |
| [Email Service](/email-service/) | Inspect locally routed and sent email | Send test messages to `email()` handlers |
| [Workflows](/workflows/) | List instances, view status and step history | Trigger new runs, retry failed instances |

### D1 and Durable Objects SQL Studio

For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [SQLite storage API](/durable-objects/api/sqlite-storage-api/), Local Explorer includes a SQL Studio. This is the same experience available in the Cloudflare dashboard for deployed D1 databases. It provides both a visual table browser with inline editing and a SQL query editor where you can run arbitrary queries.

### Email Service

Local Explorer captures email activity during local development. The **Routing** view lists messages delivered to the `email()` handler. Select a message to inspect its headers, body, attachments, and handler actions. You can also compose a test message and deliver it to the handler.

The **Sending** view lists messages sent through local [`send_email` bindings](/email-service/api/send-emails/workers-api/). Select a message to inspect its recipients, headers, attachments, and captured body.

For configuration and testing examples, refer to [Email routing local development](/email-service/local-development/routing/) and [Email sending local development](/email-service/local-development/sending/).

## Observability

Local Explorer automatically captures traces and logs from every Worker invocation during `wrangler dev` without modifying your code. You get the same instrumentation as production [Workers Logs](/workers/observability/logs/workers-logs/) and [Traces](/workers/observability/traces/), including invocation logs, binding operations, timing, and console output, directly in your browser during development.
Expand Down
Loading