Skip to the documentation
Client

Errors

Every failure throws, with the same two classes as `@nextmail/sdk`.

Catching one

catch-errors.ts
import { NextmailApiError, NextmailNetworkError } from '@nextmail/mailbox' try {  await client.emails.send(message)} catch (error) {  if (error instanceof NextmailApiError) {    if (error.isPermission) console.error('this person or app cannot do that')    if (error.isRateLimited) console.error('try again in', error.retryAfterSeconds, 'seconds')     console.error(error.status, error.requestId)  }   if (error instanceof NextmailNetworkError && error.isTimeout) console.error('no answer in time')   throw error}

A permission_error means the person cannot reach that address or thread, or their approval of your app does not cover it. Check what they can send from with client.addresses.list().

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.