testing-with-sandbox

Capture outbound email in Mailtrap sandboxes for inspection and testing.

7|1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/mailtrap/mailtrap-skills --skill testing-with-sandbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-with-sandbox
Source: https://github.com/mailtrap/mailtrap-skills/tree/main/skills/testing-with-sandbox
Command: npx skills add https://github.com/mailtrap/mailtrap-skills --skill testing-with-sandbox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents accidental delivery of development or staging emails to real recipients by capturing outbound messages in isolated sandboxes for inspection, validation, and automated testing.

Core Features & Use Cases

  • Capture and inspect messages sent via SDKs, HTTP API, or SMTP without delivering to end users.
  • Validate content and structure including HTML bodies, headers, attachments, and basic spam/format checks.
  • Automation and CI: read messages from the Sandbox API to assert delivery behavior, template rendering, or integration workflows.

Quick Start

Send a test email to a Mailtrap sandbox using its inbox id and a testing-scoped API token or configure your app to use sandbox.smtp.mailtrap.io with the sandbox SMTP credentials.

Frequently Asked Questions about testing-with-sandbox

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture outbound email in staging without delivering to real recipients?

You can capture outbound email in staging by routing messages to an isolated sandbox, preventing delivery to real recipients while enabling inspection. This requires a sandbox inbox id and a testing-scoped API token to intercept messages safely.

Can I use sandbox SMTP credentials for integration testing?

Yes, you can use sandbox SMTP credentials for integration testing by configuring your application to target sandbox.smtp.mailtrap.io. This captures outbound messages safely for inspection without delivering them to actual end users.

How does testing outbound email work with HTTP API and SMTP?

Testing outbound email works by sending messages via HTTP API or SMTP into sandbox endpoints, intercepting the delivery for validation. You can inspect HTML bodies, headers, and attachments to debug templates and verify integration workflows.

What's the best way to validate email templates in a CI pipeline?

The best way to validate email templates in a CI pipeline is to read captured messages from the Sandbox API to assert delivery behavior and template rendering. This automates inspection of HTML bodies and headers during integration testing.

Do I need a sandbox inbox id to test outbound email?

Yes, you need a sandbox inbox id and a testing-scoped API token to test outbound email. These credentials ensure your development messages are routed to the isolated sandbox for inspection rather than reaching real recipients.

Why are my development emails not delivering to end users?

Your development emails are not delivering to end users because they are being captured in isolated sandboxes. This mechanism prevents accidental delivery to real recipients, routing outbound messages to sandbox endpoints for safe inspection instead.