MCP HubMCP Hub
SKILL·BD95A5

testing-with-sandbox

mailtrap
更新日 27 days ago
5 閲覧
9
1
9
GitHubで表示
テストaitestingapiautomation

について

このスキルは、開発者が実際の受信者に送信する代わりに安全なサンドボックス環境でメッセージを捕捉することで、送信メール機能をテストできるようにします。開発環境やステージング環境において、メール内容の確認、スパムチェックの実行、偽の受信箱に対する自動テストを行うために使用されます。Mailtrap Email Sandboxなどのサービスと連携する際、SDK、HTTP API、またはSMTPを介した統合をサポートしています。

クイックインストール

Claude Code

推奨
メイン
npx skills add mailtrap/mailtrap-skills -a claude-code
プラグインコマンド代替
/plugin add https://github.com/mailtrap/mailtrap-skills
Git クローン代替
git clone https://github.com/mailtrap/mailtrap-skills.git ~/.claude/skills/testing-with-sandbox

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

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.

GitHub リポジトリ

mailtrap/mailtrap-skills
パス: skills/testing-with-sandbox
0
FAQ

よくある質問

testing-with-sandbox Skillとは何ですか?

testing-with-sandbox はmailtrap が作成した Claude Skillです。Skillは、Claudeが必要に応じて読み込む指示とリソースをまとめ、追加の指示なしで testing-with-sandbox に関連するタスクを実行できるようにします。

testing-with-sandbox をインストールするには?

このページのインストールコマンドを使用してください。testing-with-sandbox をプラグインとして Claude Code に追加するか、リポジトリを skills ディレクトリにクローンし、Claudeを再起動してSkillを読み込みます。

testing-with-sandbox はどのカテゴリに属しますか?

testing-with-sandbox は テスト カテゴリに属します。

testing-with-sandbox は無料で利用できますか?

はい。testing-with-sandbox は AIMCP に掲載されており、無料でインストールできます。

関連スキル

evaluating-llms-harness
テスト

このClaudeスキルは、lm-evaluation-harnessを実行し、MMLUやGSM8Kなど60以上の標準化学術タスクでLLMをベンチマークします。開発者がモデルの品質を比較し、トレーニングの進捗を追跡し、学術的な結果を報告するために設計されています。このツールはHuggingFaceやvLLMモデルを含む様々なバックエンドをサポートしています。

スキルを見る
cloudflare-cron-triggers
テスト

このスキルは、cron式を使用してWorkersをスケジュールするためのCloudflare Cron Triggersの実装に関する包括的な知識を提供します。定期的なタスクの設定、メンテナンスジョブ、自動化されたワークフローの構築を網羅し、無効なcron式やタイムゾーン問題といった一般的な課題への対処法も含みます。開発者はこれを使用して、スケジュールされたハンドラーの設定、cronトリガーのテスト、WorkflowsやGreen Computeとの連携を構成できます。

スキルを見る
webapp-testing
テスト

このClaude Skillは、Playwrightベースのツールキットを提供し、Pythonスクリプトを通じてローカルWebアプリケーションのテストを可能にします。フロントエンドの検証、UIデバッグ、スクリーンショット撮影、ログ表示を実現し、サーバーライフサイクルを管理します。ブラウザ自動化タスクにご利用いただけますが、コンテキストの汚染を避けるため、スクリプトのソースコードを読むのではなく直接実行してください。

スキルを見る
finishing-a-development-branch
テスト

このスキルは、開発者がテストの合格を確認し、構造化された統合オプションを提示することで、完成した作業を仕上げることを支援します。実装が完了した後のマージ、PR作成、ブランチの整理といったワークフローを案内します。コードが準備できてテスト済みの際に使用し、開発プロセスを体系的に完了させましょう。

スキルを見る