# Mailtrap (/docs/adapters/mailtrap)



<ProviderBadge adapter="mailtrap" />

```ts
import { createEmailClient } from "email-sdk";
import { mailtrap } from "email-sdk/mailtrap";

const email = createEmailClient({
  adapters: [mailtrap({ apiKey: process.env.MAILTRAP_API_KEY! })],
});
```

## Options [#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 <a href="/docs/adapters/field-support">field support</a> for supported message fields.
