Skip to content
You're viewing documentation for v0.6.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Mailtrap

Configure the Mailtrap Email Sending API adapter.

Mailtrap logo
Mailtrap@opencoredev/email-sdk/mailtrap
Provider docs

Mailtrap sends through the Mailtrap Email Sending API. It supports broad API-style fields and is also useful for staging environments where you want provider-side message inspection.

Before live sends

Create a Mailtrap API token for Email Sending and verify the sender or domain. If you use a Mailtrap sandbox or staging inbox, confirm the target environment is using the intended Mailtrap project before sending production mail.

Configure

Send

Mailtrap accepts one Email SDK tag. The adapter maps that tag value to the provider category field and rejects additional tags.

Send with an attachment

Options

Option Type Required Notes
apiKey string Yes Mailtrap API token.
baseUrl string No Defaults to https://send.api.mailtrap.io.
fetch typeof fetch No Useful for tests or custom runtimes.

See field support for supported message fields.

Mailtrap maps replyTo to reply_to, metadata to custom_variables, and the first returned message_ids value to the SDK response ID.

Response

The adapter uses the first returned message_ids value, then falls back to message_id or id, and exposes it as normalized id and messageId.

CLI smoke test

Last updated on