testing-with-sandbox
Use when capturing outbound email in development or staging without delivering to real recipients, inspecting HTML or headers, running spam or structure…
Skill by mailtrap
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mailtrap-testing-with-sandbox
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, backend, testing, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/testing-with-sandbox
What's inside
- Skill name
testing-with-sandbox- Description
- Use when capturing outbound email in development or staging without delivering to real recipients, inspecting HTML or headers, running spam or structure checks, or automating tests against a fake inbox. Use when testing outgoing mail from an app without committing to a production ESP yet. Use when using Mailtrap Email Sandbox, Sandbox API, or sandbox-mode sending.
- License
- MIT
- Instructions
- 100 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Testing with Mailtrap Email Sandbox
## Overview
**Email Sandbox** captures mail in **sandboxes (test inboxes)**—a test environment where messages are **not** delivered to real recipients. You can send to sandboxes using our **SDKs**, **HTTP API**, or **SMTP**, depending on your needs.
**Before generating SDK code:** read the README of the relevant SDK repository (see `sending-emails`) for current sandbox mode options, **inbox id**, and constructor flags. Do not rely on memory.
**Related skills:** `authorizing-api-requests` (sandbox token scope, env vars, `account_id` resolution), `sending-emails` (live sending hosts and streams), `using-email-templates` (preview template sends in sandbox).
## When to use
- You want **no real delivery**: dev, staging, CI, or demos where mail must stay in a **test inbox**.
- You need to **inspect** what was sent: bodies, headers, attachments, or basic checks (e.g. spam report) via **Sandbox / Testing API** or the **UI**.
- You are **automating** tests against captured mail.
- You will **only change SMTP settings** so an existing app sends into a sandbox—no need for a framework-by-framework tutorial from this skill.
## When not to use
- **Live** sends to real recipients (`sending-emails`).
- For full framework setup guides or detailed API references, link users to Mailtrap's Integration tab for SMTP/API details and the [API docs](https://docs.mailtrap.io/developers/) for specifics—don't cover every framework or API field here.
## Quick reference
### API base
| Service | Send mail URL | Auth header examples |
| ------------------------ | ----------------------------------------------------- | ------------------------------------------------- |
| Email Testing API (REST) | `https://sandbox.api.mailtrap.io/api/send/{inbox_id}` | `Authorization: Bearer $MAILTRAP_SANDBOX_API_TOKEN` |
### Tokens and account_id
Sandbox uses a **separate** token (`$MAILTRAP_SANDBOX_API_TOKEN`, Testing/Sandbox scope) — never reuse the live `$MAILTRAP_API_TOKEN`. The `account_id` in the example endpoints below is resolved at runtime via `GET https://mailtrap.io/api/accounts`. Full token scope, storage, and `account_id` resolution: see skill `authorizing-api-requests`.
### When to use API vs SMTP
Use **SMTP** when testing apps that already send mail via SMTP (just update the host, port, and credentials).
Use the **HTTP API** when building new integrations or your app can make HTTP requests; it's better for programmatic testing and automation.
### SMTP settings (sandbox)
| Setting | Value |
| ------------------- | --------------------------------------------------------------------------- |
| Host | `sandbox.smtp.mailtrap.io` |
| Ports | 2525 (default), 25, 465 (SSL), 587 |
| Username / Password | Per **sandbox** credentials from the **Integration** tab in the Mailtrap UI |
**Never use sandbox credentials or endpoints in production. Messages will only be captured in the sandbox, not delivered.**
### Key parameters
- **Inbox ID**: Every sandbox (test inbox) has a unique **inbox id**, visible in the UI URL and needed for sending or REST API operations.
- **Token scope**: Use a token with permissions for the relevant project and test inbox.
### Typical use cases
- Capture all outbound mail in dev, test, or staging (no real recipients).
- View, validate, and assert message headers, bodies, HTML, attachments, or spam score.
- Run integration or CI checks that read from the Email Sandbox API.
- Test Mailtrap **templates** by pointing API or SDK/SMTP at `sandbox.api.mailtrap.io` / `sandbox.smtp.mailtrap.io` with a valid inbox id.
### Example API paths
Use [API docs](https://docs.mailtrap.io/developers/) for details, but typical endpoints include:
| Operation | URL | Reference |
| --------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| List sandboxes | `GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes` | [Sandboxes API](https://docs.mailtrap.io/developers/email-sandbox/sandboxes-inboxes.md) |
| List messages | `GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messages` | [Messages](https://docs.mailtrap.io/developers/email-sandbox/messages.md) |
| Fetch a message | `GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messages/{id}` | [Message details](https://docs.mailtrap.io/developers/email-sandbox/messages.md) |
| Send test email | `POST https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messages` | [Send test emails](https://docs.mailtrap.io/developers/email-sandbox/send-test-emails.md) |
For **template testing**, see the Integration tab of your template and [Handlebars](https://docs.mailtrap.io/email-api-smtp/email-templates/handlebars.md).
### SDKs
Official Mailtrap SDKs support sandbox/inbox operations and provide flags or methods to set **test mode** and **inbox id**. This allows you to use the same integration for both live sending and sandbox testing—simply change the mode or credentials depending on your environment (development, staging, or production). For install commands and language coverage, see [Mailtrap developer documentation](https://docs.mailtrap.io/developers/). Repository READMEs have the latest sandbox options:
- [Node.js](https://github.com/mailtrap/mailtrap-nodejs)
- [Python](https://github.com/mailtrap/mailtrap-python)
- [PHP](https://github.com/mailtrap/mailtrap-php)
- [Ruby](https://github.com/mailtrap/mailtrap-ruby)
- [Java](https://github.com/mailtrap/mailtrap-java)
- [.NET](https://github.com/mailtrap/mailtrap-dotnet)
- [CLI](https://github.com/mailtrap/mailtrap-cli)
### Common mistakes
| Mistake | Fix/Explanation |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| Expecting real delivery from sandbox | Mail in the sandbox is **never** delivered to recipients |
| Using production API token for sandbox | Use a token with proper **sandbox/testing** scope, granting access to the target inbox |
| Forgetting **inbox id** parameter | Always supply the **inbox id** (from UI or Integration tab) to associate messages with the correct inbox |
| Mixing sandbox and transactional endpoints | Testing API (`sandbox.api.mailtrap.io`) is **not** the same as `send.api.mailtrap.io` (live sending)! |
### Sandbox email address
Each sandbox (test inbox) has an address like `alias@inbox.mailtrap.io` for inbound tests; plus-addressing can help isolate scenarios. See [Email address per sandbox](https://docs.mailtrap.io/email-sandbox/setup/email-address-per-sandbox.md) for limits and behavior.From mailtrap/mailtrap-skills, MIT.
More from mailtrap/mailtrap-skills
- 0.547score
converting-email-templates
mailtrap
Use when converting or migrating email templates from another provider (SendGrid, Mailgun, Mandrill, Postmark, Brevo, Amazon SES) to Mailtrap-compatible…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
authorizing-api-requests
mailtrap
Use when authenticating or authorizing requests to any Mailtrap API (Email Send, Email Testing/Sandbox, Templates, Contacts, Sending Domains, Suppressions).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
managing-contacts
mailtrap
Use when using Mailtrap Contacts API or UI to add, update, bulk import, list, segment marketing contacts, custom fields, or custom events.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
sending-emails
mailtrap
Use when integrating, configuring, or troubleshooting Mailtrap live email sending (Email API or SMTP).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
setting-up-sending-domain
mailtrap
Use when adding or verifying a Mailtrap sending domain, DNS propagation issues, registrar or DNS provider steps, compliance after verification, or click…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
using-email-templates
mailtrap
Use when creating or sending Mailtrap-hosted email templates, Handlebars personalization, template UUID in API payloads, or debugging variables and preview.
SkillCFreshness: C★ 11Claude Code +9
Signals
- Stars
- 11
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- May 13, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mailtrap/mailtrap-skills
- Website
- mailtrap.io
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mailtrap
- 0.547score
converting-email-templates
mailtrap
Use when converting or migrating email templates from another provider (SendGrid, Mailgun, Mandrill, Postmark, Brevo, Amazon SES) to Mailtrap-compatible…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
authorizing-api-requests
mailtrap
Use when authenticating or authorizing requests to any Mailtrap API (Email Send, Email Testing/Sandbox, Templates, Contacts, Sending Domains, Suppressions).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
managing-contacts
mailtrap
Use when using Mailtrap Contacts API or UI to add, update, bulk import, list, segment marketing contacts, custom fields, or custom events.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
sending-emails
mailtrap
Use when integrating, configuring, or troubleshooting Mailtrap live email sending (Email API or SMTP).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
setting-up-sending-domain
mailtrap
Use when adding or verifying a Mailtrap sending domain, DNS propagation issues, registrar or DNS provider steps, compliance after verification, or click…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
using-email-templates
mailtrap
Use when creating or sending Mailtrap-hosted email templates, Handlebars personalization, template UUID in API payloads, or debugging variables and preview.
SkillCFreshness: C★ 11Claude Code +9
Cite this page
testing-with-sandbox skill. Agent Mart. https://agentmart.dev/skills/mailtrap-testing-with-sandbox (last updated 2026-10-24)