---
title: Postmark
description: Send through the Postmark Email API with message streams, metadata, and Postmark's single-tag model.
sidebar:
  icon: "https://www.google.com/s2/favicons?domain=postmarkapp.com&sz=64"
---

## Capabilities

| Repeated headers | Idempotency | Scheduling | Personalized |
| ---------------- | ----------- | ---------- | ------------ |
| Yes              | `none`      | No         | `expanded`   |

These values come from the adapter's exported `capabilities` declaration. The [field support matrix](/v3.0.1/docs/adapters/field-support) covers normalized message fields.

The Postmark adapter calls the [Postmark Email API](https://postmarkapp.com/developer/api/email-api) with plain `fetch`. Its distinctive feature is message streams: set `messageStream` once and every send routes through that Postmark stream.



**[Postmark](https://postmarkapp.com)** · `@opencoredev/email-sdk/postmark` · [setup guide](/docs/adapters/postmark)



## Configure

Create a [server token](https://postmarkapp.com/developer/api/overview#authentication) for the server you send through, and make sure the sender signature or domain is approved in Postmark.

```ts title="lib/email.ts"
import { createEmailClient } from "@opencoredev/email-sdk";
import { postmark } from "@opencoredev/email-sdk/postmark";

export const email = createEmailClient({
  adapters: [
    postmark({
      serverToken: process.env.POSTMARK_SERVER_TOKEN!,
      messageStream: "outbound",
    }),
  ],
});
```

| Prop | Type | Default | Description |
| - | - | - | - |
| `serverToken` | `string` | - | Postmark server token. |
| `messageStream?` | `string` | - | Postmark message stream to send through. |
| `baseUrl?` | `string` | `"https://api.postmarkapp.com"` | Override the API origin, e.g. for a proxy. |
| `fetch?` | `typeof fetch` | - | Custom fetch implementation for tests or special runtimes. |
| `headers?` | `Record<string, string>` | - | Extra HTTP headers sent with every request. |

## Send

Postmark maps `cc`, `bcc`, `replyTo`, `headers`, `attachments`, `metadata`, and one tag.

```ts
const result = await email.send({
  from: "Acme <hello@acme.com>",
  to: "user@example.com",
  replyTo: "support@example.com",
  subject: "Your receipt for order ord_123",
  html: "<p>Thanks for your order.</p>",
  metadata: { orderId: "ord_123" },
  tags: [{ name: "type", value: "receipt" }],
});

console.log(result.id); // Postmark MessageID
```

`metadata` becomes Postmark `Metadata`, and `result.accepted` echoes Postmark's `To` line.

:::warning[One tag per message]
Postmark has a single `Tag` field. The adapter serializes the first tag as `name:value` and a
second tag throws an `EmailValidationError` before any request is made. Need multiple tags? Check
the [field support matrix](/v3.0.1/docs/adapters/field-support).
:::

## Verify from the CLI

```bash
POSTMARK_SERVER_TOKEN="..." npx --package @opencoredev/email-sdk email-sdk doctor --adapter postmark
```

```bash
POSTMARK_SERVER_TOKEN="..." npx --package @opencoredev/email-sdk email-sdk send \
  --adapter postmark \
  --message-stream outbound \
  --from "Acme <hello@acme.com>" \
  --to user@example.com \
  --subject "Postmark smoke test" \
  --text "It works" \
  --dry-run
```

The token also accepts the `--server-token` flag. Drop `--dry-run` for one real send to confirm the server token, sender signature, and message stream actually work together.

## Compare Postmark with other providers

Side-by-side message-field support from the SDK capability matrix, with working code for both adapters:

- [Resend vs Postmark](/compare/resend-vs-postmark)
- [Postmark vs SendGrid](/compare/postmark-vs-sendgrid)
- [Postmark vs Mailgun](/compare/postmark-vs-mailgun)
- [Postmark vs AWS SES](/compare/postmark-vs-ses)
