MCP HubMCP Hub
SKILL·BD95A5

testing-with-sandbox

mailtrap
Mis à jour 27 days ago
5 vues
9
1
9
Voir sur GitHub
Testsaitestingapiautomation

À propos

Cette compétence permet aux développeurs de tester la fonctionnalité d'envoi d'emails en capturant les messages dans un environnement sandbox sécurisé, au lieu de les envoyer à de véritables destinataires. Elle est utilisée pour inspecter le contenu des emails, effectuer des contrôles anti-spam et automatiser des tests sur une boîte de réception fictive pendant les phases de développement ou de préproduction. La compétence prend en charge l'intégration via des SDK, une API HTTP ou le protocole SMTP lors de l'utilisation de services tels que Mailtrap Email Sandbox.

Installation rapide

Claude Code

Recommandé
Principal
npx skills add mailtrap/mailtrap-skills -a claude-code
Commande PluginAlternatif
/plugin add https://github.com/mailtrap/mailtrap-skills
Git CloneAlternatif
git clone https://github.com/mailtrap/mailtrap-skills.git ~/.claude/skills/testing-with-sandbox

Copiez et collez cette commande dans Claude Code pour installer cette compétence

Documentation

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 for specifics—don't cover every framework or API field here.

Quick reference

API base

ServiceSend mail URLAuth 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)

SettingValue
Hostsandbox.smtp.mailtrap.io
Ports2525 (default), 25, 465 (SSL), 587
Username / PasswordPer 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 for details, but typical endpoints include:

OperationURLReference
List sandboxesGET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxesSandboxes API
List messagesGET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messagesMessages
Fetch a messageGET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messages/{id}Message details
Send test emailPOST https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes/{inbox_id}/messagesSend test emails

For template testing, see the Integration tab of your template and Handlebars.

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. Repository READMEs have the latest sandbox options:

Common mistakes

MistakeFix/Explanation
Expecting real delivery from sandboxMail in the sandbox is never delivered to recipients
Using production API token for sandboxUse a token with proper sandbox/testing scope, granting access to the target inbox
Forgetting inbox id parameterAlways supply the inbox id (from UI or Integration tab) to associate messages with the correct inbox
Mixing sandbox and transactional endpointsTesting 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 [email protected] for inbound tests; plus-addressing can help isolate scenarios. See Email address per sandbox for limits and behavior.

Dépôt GitHub

mailtrap/mailtrap-skills
Chemin: skills/testing-with-sandbox
0
FAQ

Questions fréquentes

Qu’est-ce que le Skill testing-with-sandbox ?

testing-with-sandbox est un Skill Claude créé par mailtrap. Un Skill regroupe des instructions et des ressources que Claude charge à la demande pour effectuer des tâches liées à testing-with-sandbox sans consigne supplémentaire.

Comment installer testing-with-sandbox ?

Utilisez les commandes d’installation de cette page : ajoutez testing-with-sandbox à Claude Code comme plugin ou clonez son dépôt dans votre dossier skills, puis redémarrez Claude pour charger le Skill.

À quelle catégorie appartient testing-with-sandbox ?

testing-with-sandbox appartient à la catégorie Tests.

testing-with-sandbox est-il gratuit ?

Oui. testing-with-sandbox est référencé sur AIMCP et son installation est gratuite.

Compétences associées

evaluating-llms-harness
Tests

Cette compétence Claude exécute le lm-evaluation-harness pour évaluer les modèles de langage sur plus de 60 tâches académiques standardisées telles que MMLU et GSM8K. Elle est conçue pour permettre aux développeurs de comparer la qualité des modèles, de suivre les progrès de l'entraînement ou de rapporter des résultats académiques. L'outil prend en charge différents backends, incluant les modèles HuggingFace et vLLM.

Voir la compétence
cloudflare-cron-triggers
Tests

Cette compétence fournit une connaissance complète pour la mise en œuvre de Déclencheurs Cron Cloudflare afin de planifier des Workers à l'aide d'expressions cron. Elle couvre la configuration de tâches périodiques, de travaux de maintenance et de flux de travail automatisés, tout en traitant des problèmes courants tels que les expressions cron non valides et les problèmes de fuseau horaire. Les développeurs peuvent l'utiliser pour configurer des gestionnaires planifiés, tester des déclencheurs cron et intégrer avec Workflows et Green Compute.

Voir la compétence
webapp-testing
Tests

Cette Compétence Claude fournit une boîte à outils basée sur Playwright pour tester des applications web locales via des scripts Python. Elle permet la vérification frontend, le débogage d'interface utilisateur, la capture d'écrans et la consultation des journaux, tout en gérant les cycles de vie du serveur. Utilisez-la pour les tâches d'automatisation de navigateur, mais exécutez les scripts directement plutôt que de lire leur code source pour éviter la pollution du contexte.

Voir la compétence
finishing-a-development-branch
Tests

Cette compétence aide les développeurs à finaliser leur travail en vérifiant que les tests passent, puis en présentant des options d'intégration structurées. Elle guide le processus de fusion, de création de PRs ou de nettoyage des branches une fois l'implémentation terminée. Utilisez-la lorsque votre code est prêt et testé pour finaliser systématiquement le cycle de développement.

Voir la compétence