Skip to content
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Mailtrap

Send through the Mailtrap Email Sending API with full field support and provider-side message inspection.

Capabilities

Repeated headers Idempotency Scheduling Personalized
No none No expanded

These values come from the adapter’s exported capabilities declaration. The field support matrix covers normalized message fields.

The Mailtrap adapter calls the Mailtrap Email Sending API with plain fetch. It supports every common transactional field, and Mailtrap’s inspection tooling makes it a natural pick for staging environments.

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

Configure

Create a Mailtrap API token with Email Sending permission and verify your sending domain.

PropType
apiKeystring

Mailtrap API token, sent as the Api-Token header.

Typestring
baseUrl?string

Override the API origin, e.g. for a proxy.

Typestring
Default"https://send.api.mailtrap.io"
fetch?typeof fetch

Custom fetch implementation for tests or special runtimes.

Typetypeof fetch

Send

Mailtrap maps cc, bcc, headers, attachments, metadata, and tags, with two limits: at most one tag (its value becomes the Mailtrap category) and at most one replyTo. metadata is sent as custom_variables with values stringified (null becomes "").

Verify from the CLI

Drop --dry-run for one real smoke send, and confirm the token targets the intended Mailtrap project before pointing production at it.

Frequently asked questions

Does Email SDK support Mailtrap?

Yes. Email SDK ships a Mailtrap adapter imported from @opencoredev/email-sdk/mailtrap. You keep your Mailtrap account and credentials; the SDK adds message validation, typed errors, and no-network test adapters around the same send() call used for every other provider.

Which message fields does the Mailtrap adapter support?

Mailtrap supports CC recipients, BCC recipients, Reply-To address, Custom headers, Attachments, Tags, and Metadata. It does not support Scheduled sending (sendAt); Email SDK rejects a message that uses those fields before any request is made.

Can Mailtrap schedule email for later with Email SDK?

No. Mailtrap has no provider-side scheduling, so a message with sendAt fails validation. Store the job in your own queue and send when it is due.

Does the Mailtrap adapter support idempotent sends?

No. Mailtrap has no provider-side idempotency, so a retried send can be delivered twice. A send with idempotencyKey on a route that includes Mailtrap fails with EmailValidationError unless you pass idempotency: “best-effort”. Deduplicate in your own queue before retrying.

Last updated on