---
title: "nextmail tools"
description: "Every command in this namespace, with its arguments, flags and examples."
url: "https://nextmail.sh/docs/cli/reference/tools"
area: "CLI"
category: "Reference"
---

# nextmail tools

Every command in this namespace, with its arguments, flags and examples.

## Commands

### `nextmail tools check-dmarc`

Check a domain's DMARC policy

```bash
nextmail tools check-dmarc <domain> [flags]
```

Reads the domain's DMARC record from public DNS, or the record of the organisational domain it inherits from, and says how strict it is and what is wrong with it, the DMARC checker on the Nextmail website. `stage` is `missing`, `invalid`, `monitor` for `p=none`, `quarantine` or `reject`, and `issues` lists the problems written to be shown to a person.

- Needs a sign-in.

**Arguments**

- `<domain>` (required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.

**Examples**

```bash
nextmail tools check-dmarc acme.com
```

Print the raw JSON

```bash
nextmail tools check-dmarc acme.com --json
```

Also available in: API [`GET /tools/dmarc`](https://nextmail.sh/docs/api/reference/tools#get-tools-dmarc); TypeScript [`nextmail.tools.checkDmarc()`](https://nextmail.sh/docs/sdk/reference/tools#checkDmarc); Python [`tools.check_dmarc()`](https://nextmail.sh/docs/python/reference/tools#checkDmarc); Ruby [`tools.check_dmarc`](https://nextmail.sh/docs/ruby/reference/tools#checkDmarc); PHP [`tools->checkDmarc`](https://nextmail.sh/docs/php/reference/tools#checkDmarc); Go [`Tools.CheckDmarc`](https://nextmail.sh/docs/go/reference/tools#checkDmarc); Java [`tools().checkDmarc`](https://nextmail.sh/docs/java/reference/tools#checkDmarc); C# [`Tools.CheckDmarcAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkDmarc).

### `nextmail tools check-bimi`

Check a domain's BIMI logo

```bash
nextmail tools check-bimi <domain> [flags]
```

Reads the domain's BIMI record, fetches the logo it names and checks the DMARC policy beside it, since inboxes draw a logo only at `p=quarantine` or `p=reject`, the BIMI checker on the Nextmail website. `status` is `present`, `partial` when the record is there but something stops inboxes showing the logo, `absent` or `invalid`, and `issues` says why.

- Needs a sign-in.

**Arguments**

- `<domain>` (required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.

**Examples**

```bash
nextmail tools check-bimi acme.com
```

Print the raw JSON

```bash
nextmail tools check-bimi acme.com --json
```

Also available in: API [`GET /tools/bimi`](https://nextmail.sh/docs/api/reference/tools#get-tools-bimi); TypeScript [`nextmail.tools.checkBimi()`](https://nextmail.sh/docs/sdk/reference/tools#checkBimi); Python [`tools.check_bimi()`](https://nextmail.sh/docs/python/reference/tools#checkBimi); Ruby [`tools.check_bimi`](https://nextmail.sh/docs/ruby/reference/tools#checkBimi); PHP [`tools->checkBimi`](https://nextmail.sh/docs/php/reference/tools#checkBimi); Go [`Tools.CheckBimi`](https://nextmail.sh/docs/go/reference/tools#checkBimi); Java [`tools().checkBimi`](https://nextmail.sh/docs/java/reference/tools#checkBimi); C# [`Tools.CheckBimiAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkBimi).

### `nextmail tools check-deliverability`

Check a domain's deliverability

```bash
nextmail tools check-deliverability <domain> [flags]
```

Checks the records a receiving mailbox reads before it trusts mail from the domain, the deliverability checker on the Nextmail website: MX, SPF, DKIM at the selectors its mail provider uses, DMARC and BIMI. Each check says `pass`, `warn`, `fail` or `absent` with a verdict and notes, and `score` weighs them into 0 to 100, graded `A` to `F`.

- Needs a sign-in.

**Arguments**

- `<domain>` (required): The domain to check, such as `acme.com`. An email address or a URL is read as its domain, and any public domain works, not only the ones in this workspace.

**Examples**

```bash
nextmail tools check-deliverability acme.com
```

Print the raw JSON

```bash
nextmail tools check-deliverability acme.com --json
```

Also available in: API [`GET /tools/deliverability`](https://nextmail.sh/docs/api/reference/tools#get-tools-deliverability); TypeScript [`nextmail.tools.checkDeliverability()`](https://nextmail.sh/docs/sdk/reference/tools#checkDeliverability); Python [`tools.check_deliverability()`](https://nextmail.sh/docs/python/reference/tools#checkDeliverability); Ruby [`tools.check_deliverability`](https://nextmail.sh/docs/ruby/reference/tools#checkDeliverability); PHP [`tools->checkDeliverability`](https://nextmail.sh/docs/php/reference/tools#checkDeliverability); Go [`Tools.CheckDeliverability`](https://nextmail.sh/docs/go/reference/tools#checkDeliverability); Java [`tools().checkDeliverability`](https://nextmail.sh/docs/java/reference/tools#checkDeliverability); C# [`Tools.CheckDeliverabilityAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkDeliverability).

### `nextmail tools read-verification-code`

Read the sign-in code in a message

```bash
nextmail tools read-verification-code [flags]
```

Finds the sign-in or verification code in a message you pass in, with the reader that puts a code at the top of a message in Nextmail. Send the whole MIME source as `raw`, or the `subject` with `html` or `text`.

It answers only when it is sure: the message has to hold exactly one code worded as one, such as a verification code, a one-time code or a security code, in any of the common languages. Two different codes, or a number that could be an order, a booking, a meeting, a phone number or a promotion, give `code: null`.

It reads only what you send, so it cannot tell whether the sender is who it claims to be. The `verificationCode` on a message in your mailbox also requires the sender to pass authentication.

- Needs a sign-in.

**Flags**

- `--raw <value>`: The whole message as MIME source, as it was received. Wins over the other fields when it is set.
- `--subject <value>`: Subject line, at most 998 characters.
- `--html <value>`: HTML body. Links are left out before the code is looked for.
- `--text <value>`: Plain text body, used when there is no `html`.
- `--data <json|@file|->`: The whole `body` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

```bash
nextmail tools read-verification-code
```

With optional flags

```bash
nextmail tools read-verification-code --subject 'Your verification code' --html '<p>Your code is <b>396-696</b>. It expires in 10 minutes.</p>'
```

Also available in: API [`POST /tools/verification-code`](https://nextmail.sh/docs/api/reference/tools#post-tools-verification-code); TypeScript [`nextmail.tools.readVerificationCode()`](https://nextmail.sh/docs/sdk/reference/tools#readVerificationCode); Python [`tools.read_verification_code()`](https://nextmail.sh/docs/python/reference/tools#readVerificationCode); Ruby [`tools.read_verification_code`](https://nextmail.sh/docs/ruby/reference/tools#readVerificationCode); PHP [`tools->readVerificationCode`](https://nextmail.sh/docs/php/reference/tools#readVerificationCode); Go [`Tools.ReadVerificationCode`](https://nextmail.sh/docs/go/reference/tools#readVerificationCode); Java [`tools().readVerificationCode`](https://nextmail.sh/docs/java/reference/tools#readVerificationCode); C# [`Tools.ReadVerificationCodeAsync`](https://nextmail.sh/docs/csharp/reference/tools#readVerificationCode).

### `nextmail tools estimate-cost`

Estimate what Nextmail costs for a usage

```bash
nextmail tools estimate-cost [flags]
```

Prices every plan for the usage you describe, as the cost calculator on the Nextmail website does: the plan itself, the extra sends and AI actions it would bill, the monthly total, and whether the plan fits at all. A plan does not fit when the usage needs more domains than it includes, more than one person without team access, or more sends than it allows without billing extra. `cheapest` names the cheapest plan that fits.

Amounts are in US cents per month. With `interval` set to `year`, the plan price is the monthly equivalent of paying yearly.

- Needs a sign-in.

**Flags**

- `--sends <n>`: Emails sent in a month. Defaults to 0.
- `--domains <n>`: Domains you send from. Defaults to 1.
- `--people <n>`: People who use the workspace. Defaults to 1.
- `--ai-actions <n>`: AI actions in a day, such as drafts, rewrites and summaries. Defaults to 0.
- `--interval <value>`: How you pay: `month` or `year`. Defaults to `month`.

**Examples**

```bash
nextmail tools estimate-cost
```

With optional flags

```bash
nextmail tools estimate-cost --sends 25000 --domains 2 --people 4
```

Print the raw JSON

```bash
nextmail tools estimate-cost --json
```

Also available in: API [`GET /tools/cost`](https://nextmail.sh/docs/api/reference/tools#get-tools-cost); TypeScript [`nextmail.tools.estimateCost()`](https://nextmail.sh/docs/sdk/reference/tools#estimateCost); Python [`tools.estimate_cost()`](https://nextmail.sh/docs/python/reference/tools#estimateCost); Ruby [`tools.estimate_cost`](https://nextmail.sh/docs/ruby/reference/tools#estimateCost); PHP [`tools->estimateCost`](https://nextmail.sh/docs/php/reference/tools#estimateCost); Go [`Tools.EstimateCost`](https://nextmail.sh/docs/go/reference/tools#estimateCost); Java [`tools().estimateCost`](https://nextmail.sh/docs/java/reference/tools#estimateCost); C# [`Tools.EstimateCostAsync`](https://nextmail.sh/docs/csharp/reference/tools#estimateCost).

### `nextmail tools check-address`

Check an email address

```bash
nextmail tools check-address <email> [flags]
```

Says whether an address is worth sending to, the email checker on the Nextmail website: `result` is `valid`, `risky`, `invalid` or `unknown`, and `reasons` says why. It checks the syntax, whether the domain takes mail at all, whether it is a throwaway domain or a shared address such as `info@`, and offers a correction in `suggestion` for a likely typo such as `gmial.com`. Run it on a sign-up form before the first message, or over a list before a broadcast.

With the `emails:read` scope, `workspace` also says what this workspace knows: whether it suppressed the address and when it last delivered to it or saw it bounce. It never shows another workspace's history, and without the scope it is null.

`deep` also asks whether the mailbox itself exists, in `checks.mailbox`. A deep check is billed per address through pay as you go and needs the `emails:send` scope. Without it the check is free and `checks.mailbox` is null.

- Needs a sign-in.

**Arguments**

- `<email>` (required): The address to check, such as `ada@acme.com`.

**Flags**

- `--deep` (default `false`): Also ask whether the mailbox exists. Billed per address through pay as you go. Defaults to false.

**Examples**

```bash
nextmail tools check-address ada@gmial.com
```

Print the raw JSON

```bash
nextmail tools check-address ada@gmial.com --json
```

Also available in: API [`GET /tools/address`](https://nextmail.sh/docs/api/reference/tools#get-tools-address); TypeScript [`nextmail.tools.checkAddress()`](https://nextmail.sh/docs/sdk/reference/tools#checkAddress); Python [`tools.check_address()`](https://nextmail.sh/docs/python/reference/tools#checkAddress); Ruby [`tools.check_address`](https://nextmail.sh/docs/ruby/reference/tools#checkAddress); PHP [`tools->checkAddress`](https://nextmail.sh/docs/php/reference/tools#checkAddress); Go [`Tools.CheckAddress`](https://nextmail.sh/docs/go/reference/tools#checkAddress); Java [`tools().checkAddress`](https://nextmail.sh/docs/java/reference/tools#checkAddress); C# [`Tools.CheckAddressAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkAddress).

### `nextmail tools check-addresses`

Check several email addresses

```bash
nextmail tools check-addresses --emails <a,b> [flags]
nextmail tools check-addresses --data <json|@file|-> [flags]
```

Checks up to 100 addresses in one call, each as `checkAddress` does, and resolves them in the order they were sent. Use it to clean a list before importing it or sending a broadcast to it.

`deep` applies to every address and is billed for each one that reaches the mailbox check, through pay as you go, and needs the `emails:send` scope.

- Needs a sign-in.

**Flags**

- `--emails <a,b>` (repeatable): The addresses to check, from 1 to 100. Required, here or in `--data`.
- `--deep` (default `false`): Also ask whether each mailbox exists. Billed per address through pay as you go. Defaults to false.
- `--data <json|@file|->`: The whole `body` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

```bash
nextmail tools check-addresses --emails ada@acme.com,info@example.org
```

Read the whole body from a JSON file

```bash
nextmail tools check-addresses --data @tools.json
```

Also available in: API [`POST /tools/addresses`](https://nextmail.sh/docs/api/reference/tools#post-tools-addresses); TypeScript [`nextmail.tools.checkAddresses()`](https://nextmail.sh/docs/sdk/reference/tools#checkAddresses); Python [`tools.check_addresses()`](https://nextmail.sh/docs/python/reference/tools#checkAddresses); Ruby [`tools.check_addresses`](https://nextmail.sh/docs/ruby/reference/tools#checkAddresses); PHP [`tools->checkAddresses`](https://nextmail.sh/docs/php/reference/tools#checkAddresses); Go [`Tools.CheckAddresses`](https://nextmail.sh/docs/go/reference/tools#checkAddresses); Java [`tools().checkAddresses`](https://nextmail.sh/docs/java/reference/tools#checkAddresses); C# [`Tools.CheckAddressesAsync`](https://nextmail.sh/docs/csharp/reference/tools#checkAddresses).
