Skip to the documentation
Client

Install

One package, built on `@nextmail/sdk`, for the browser and every server runtime.

Install

pnpm add @nextmail/mailbox
send-email.ts
import { createClient } from '@nextmail/mailbox' const client = createClient({  accessToken: () => fetch('/api/mail-token').then((response) => response.text()),}) await client.emails.send({  from: '[email protected]',  to: '[email protected]',  subject: 'Tomorrow',  html: '<p>Still on for ten?</p>',})

@nextmail/sdk comes with it, so you add one package. If you use both in a project, they share one copy and the same error classes.

Where it runs

In a browser, in a phone app and on Node 20+, Bun, Deno and Cloudflare Workers. It uses the global fetch, or the one you pass as fetch.

OptionWhat it does
accessTokenRequired. The token, or a function that returns it or a promise of it.
baseUrlThe API to call, when it is not the default.
fetchThe fetch to use instead of the global one.
headersHeaders to send with every request.
maxRetriesHow many times a failed request is retried.
timeoutMsHow long a request may take.

Give it an address.
Watch it work.

MCP, the API and the command line come with every plan, the free one included. Connect a client and approve exactly what it reaches.

Read https://nextmail.sh/agent.md and follow it. Then tell me what I need to do to sign you in to my Nextmail mailbox. If I have no account yet, create one with my address and ask me for the code that arrives. Wait for my go-ahead before you send anything.

© 2026 Nextmail. All rights reserved.