Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #5136

mailtrap-testing-with-sandbox

Skill này làm gì

Công cụ này cho phép bạn gửi email thử nghiệm mà không đến tay người nhận thật. Nó giống như một hộp thư thử để kiểm tra email có được gửi đúng cách hay không.

Khi nào nên dùng

  • ✓Khi bạn phát triển website hoặc ứng dụng và muốn kiểm thử email gửi đi.
  • ✓Khi bạn muốn xem giao diện và nội dung email trước khi gửi cho khách hàng.
  • ✓Khi bạn chạy các bài kiểm thử tự động để đảm bảo email hoạt động đúng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mailtrap-testing-with-sandbox/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mailtrap-testing-with-sandbox/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập gửi email thử nghiệm đến hộp thư test của tôi trong Mailtrap.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cấu hình hệ thống gửi email đến một địa chỉ đặc biệt của Mailtrap thay vì địa chỉ người nhận thật. Nhờ vậy, email được lưu trong Mailtrap để bạn kiểm tra.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 mailtrap-sending-emails) for current sandbox mode options, inbox id, and constructor flags. Do not rely on memory.

Related skills: mailtrap-sending-emails (live sending hosts and streams).

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 (mailtrap-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

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. Store tokens in environment variables or a secrets manager.

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 for details, but typical endpoints include:

Operation URL Reference
List sandboxes GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/inboxes Sandboxes API

…

Câu hỏi thường gặp

Bạn có cần tài khoản Mailtrap không?

Có, bạn cần tài khoản Mailtrap để sử dụng hộp thư thử nghiệm.

Bạn có thể gửi email thật cho người khác bằng công cụ này không?

Không. Công cụ này chỉ dùng để thử nghiệm. Email không được gửi đến người nhận thật.

Làm sao để xem các email đã gửi để thử nghiệm?

Bạn có thể xem trực tiếp email trong giao diện Mailtrap, nơi chúng được lưu trữ.

Chi tiết

Mô tả gốc của tác giả

Capture outbound email in Mailtrap Email Sandbox for development, staging, CI, HTML inspection, spam checks, and fake inbox tests.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5136
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự