resend-box

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Resend Box Skill

Resend Box 工具

Resend Box is a local email sandbox that:
  1. Mocks the Resend API - Drop-in replacement for
    https://api.resend.com
  2. Runs an SMTP server - Captures emails sent via SMTP on port 1025
  3. Provides a Web UI - View captured emails at http://127.0.0.1:4657
  4. Stores emails in-memory - All emails are lost when the server restarts
Resend Box 是一个本地邮件沙箱,具备以下功能:
  1. 模拟 Resend API - 可直接替代
    https://api.resend.com
  2. 运行 SMTP 服务器 - 捕获通过端口 1025 的 SMTP 发送的邮件
  3. 提供 Web UI - 在 http://127.0.0.1:4657 查看捕获的邮件
  4. 内存存储邮件 - 服务器重启后所有邮件都会丢失

When to Use

使用场景

  • You're using the Resend SDK and want to test emails locally
  • You're sending emails via SMTP and need to verify they're sent correctly
  • You want to inspect email content (HTML, text, headers) during development
  • You need to verify emails are sent to the correct recipients
  • You're testing email templates before sending to real users
  • 你正在使用 Resend SDK 并希望在本地测试邮件
  • 你正在通过 SMTP 发送邮件,需要验证邮件是否正确发送
  • 你想在开发过程中查看邮件内容(HTML、文本、邮件头)
  • 你需要验证邮件是否发送给了正确的收件人
  • 你在向真实用户发送邮件之前测试邮件模板

Prerequisites

前置条件

Start Resend Box:
bash
npx resend-box start
Configure your project to use the sandbox - see Setup Guide.
启动 Resend Box:
bash
npx resend-box start
配置你的项目以使用沙箱 - 查看 设置指南

Quick Reference

快速参考

Send an Email (via Resend API)

通过 Resend API 发送邮件

bash
curl -X POST http://127.0.0.1:4657/emails \
  -H "Content-Type: application/json" \
  -d '{
    "from": "sender@example.com",
    "to": "recipient@example.com",
    "subject": "Test Email",
    "html": "<p>Hello!</p>"
  }'
Required fields:
from
,
to
,
subject
Optional fields:
html
,
text
,
cc
,
bcc
,
replyTo
bash
curl -X POST http://127.0.0.1:4657/emails \
  -H "Content-Type: application/json" \
  -d '{
    "from": "sender@example.com",
    "to": "recipient@example.com",
    "subject": "Test Email",
    "html": "<p>Hello!</p>"
  }'
必填字段:
from
,
to
,
subject
可选字段:
html
,
text
,
cc
,
bcc
,
replyTo

Get All Emails

获取所有邮件

bash
curl http://127.0.0.1:4657/sandbox/emails
bash
curl http://127.0.0.1:4657/sandbox/emails

Filter Emails by Recipient

按收件人筛选邮件

bash
curl "http://127.0.0.1:4657/sandbox/emails?to=user@example.com"
The
to
filter is case-insensitive and supports partial matching.
bash
curl "http://127.0.0.1:4657/sandbox/emails?to=user@example.com"
to
筛选器不区分大小写,支持部分匹配。

Get a Specific Email

获取特定邮件

bash
curl http://127.0.0.1:4657/sandbox/emails/{id}
bash
curl http://127.0.0.1:4657/sandbox/emails/{id}

Delete All Emails

删除所有邮件

bash
curl -X DELETE http://127.0.0.1:4657/sandbox/emails
bash
curl -X DELETE http://127.0.0.1:4657/sandbox/emails

View in Browser

在浏览器中查看

Open http://127.0.0.1:4657 to view captured emails in the web UI.
打开 http://127.0.0.1:4657,在 Web UI 中查看捕获的邮件。

Detailed Documentation

详细文档

  • Setup Guide - Configure your project to use Resend Box
  • Send Email Reference - Complete API for sending emails
  • Get Emails Reference - Complete API for retrieving and filtering emails
  • 设置指南 - 配置你的项目以使用 Resend Box
  • 发送邮件参考 - 发送邮件的完整 API
  • 获取邮件参考 - 检索和筛选邮件的完整 API