为 QA 与自动化开发者打造

可编程的邮箱,
专为测试而生

通过 REST API 创建和管理测试邮箱。OTP 代码自动解析为 JSON,支持 Webhook 推送。与 Playwright、Cypress、Selenium 无缝集成。

verify-signup.test.js
const inbox = await gridinbox.create();
// Email: [email protected]

await page.type('#email', inbox.email);
await page.click('#send-code');

// Auto-extracted OTP via API or Webhook
const otp = await inbox.waitForOtp({
  timeout: 30000
});

await page.type('#otp', otp.code);
console.log('✅ Verified!');

这些场景你是否遇到过?

自动化邮件测试的典型痛点。

🎭

临时邮箱服务不可靠

免费临时邮箱在生产环境中随时会被平台识别并拒绝,导致测试流程频繁中断,CI/CD 流水线不稳定。

⏱️

手动等待验证码耗尽时间

每次测试都要人工登录邮箱、找到验证码、再手动输入——自动化流水线里插入手动步骤,根本谈不上"自动化"。

🚫

大规模测试被邮箱服务限速

并发运行 50 个测试实例时,传统邮箱服务商直接封号或限速,自动化规模根本跑不起来。

三步完成集成

从注册到跑通第一个 Playwright 测试,15 分钟以内。

1

注册并获取 API Key

创建账号后立即获取 REST API 密钥。支持 Bearer Token 认证,3 分钟完成集成配置。

2

在测试中动态创建邮箱

通过一行 API 调用创建独立测试邮箱,邮件地址即时生成,持久存储,不会过期。

3

轮询邮件或接收 Webhook 推送

注册 Webhook 端点,邮件到达时立即推送解析后的 OTP JSON;或使用 waitForOtp() 方法轮询等待。

测试套件所需的一切

REST API + Webhook 双模式

使用 GET /messages 轮询,或注册 Webhook URL 在邮件到达时即时触发。两种模式均返回清洁的 JSON。

服务端 OTP 自动解析

HTML 邮件在服务端自动解析,你拿到的是 {"code": "382917", "expires_in": 540},无需自己写正则。

高并发支持,无读取限速

读取操作无速率限制。100 个并发测试实例同时运行,API 稳定响应,不封号不限速。

持久邮箱,不过期

不同于临时邮箱,GridInbox 测试邮箱持久有效。可复用于回归测试,历史邮件保留可查。

GET /api/v1/messages/latest → 200 OK
{
  "inbox": "[email protected]",
  "received_at": "2026-04-02T03:12:44Z",
  "from": "[email protected]",
  "subject": "Your verification code",
  "otp": {
    "code": "382917",
    "expires_in": 540
  }
}
Compatible Frameworks
Playwright Cypress Selenium Puppeteer Python requests LangChain n8n Make

真实 API — 复制即用

标准 HTTPS + Bearer Token 认证,无需 SDK,任何语言均可调用。

# 轮询最新 OTP(最多等待 30 秒)
export KEY=sk_live_your_api_key
export ALIAS=[email protected]
export SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)

curl -s \
  "https://api.gridinbox.com/api/v1/messages/latest-otp?alias=${ALIAS}&timeout=30&since=${SINCE}" \
  -H "Authorization: Bearer ${KEY}"

# Response:
{
  "success": true,
  "data": {
    "messageId": "018f3a2b-...",
    "subject": "Your verification code",
    "otpCode": "483920",
    "receivedAt": "2026-06-13T08:12:01Z",
    "from": "[email protected]"
  }
}

典型使用场景

🧪

注册流程自动化测试

在 CI/CD 流水线中自动测试邮件注册、验证码输入、账号激活全流程。支持 Playwright/Cypress/Selenium。

🤖

AI Agent 邮件验证

为 LangChain、AutoGPT 等 AI Agent 提供真实的邮箱用于平台注册和验证,全程无人工干预。

📊

市场数据邮件采集

向多个来源订阅行业通讯和价格报告,程序化抓取邮件内容用于市场分析和竞品监控。

🔔

系统健康监控

为生产系统设置告警邮箱,通过 Webhook 实时触发监控流程,确保关键邮件通知零延迟响应。

自动化测试邮件常见问题

Create a test inbox via the GridInbox REST API, trigger the OTP email in your test, then poll the GridInbox API for the latest email and extracted OTP. This gives you a real, isolated inbox per test run with no shared mailbox race conditions.

Yes. GridInbox's REST API supports full lifecycle management: create a fresh alias for each test case, run the test, then delete or reuse the alias. Ideal for CI/CD pipelines that need isolated, disposable email inboxes on demand.

GridInbox processes inbound emails in real time. Once delivered, OTP extraction typically completes within seconds. A polling interval of 2-3 seconds over a 30-second window reliably captures the code for most platforms.

Yes. GridInbox's API uses standard HTTPS, so it works in any CI/CD environment — GitHub Actions, GitLab CI, CircleCI, Jenkins, or Docker pipelines. Store your API key as a CI secret and call the API from your test scripts.

工程师怎么说

★★★★★

"我们需要同时跑 200 个并发注册测试。以前用各种临时邮箱工具,总在第 20 个账号时被封。GridInbox API 跑满了 200 个,完全没问题。"

— David K.
高级自动化工程师 @ DataFlow Inc.
★★★★★

"把 GridInbox 接入 Playwright 只花了 15 分钟。waitForOtp() 这个方法直接省掉了我们自己写的所有轮询逻辑,CI 里的邮件验证终于稳定了。"

— Sarah M.
QA 负责人