Mailtrap CLI app

Mailtrap CLI is a command-line tool for accessing Mailtrap features that allow you to send emails, inspect sandbox inboxes, monitor deliverability stats, and administer domains, templates, contacts, and more, all from your terminal.

Link to official GitHub documentationarrow-up-right.

How it works

Installation

To install Mailtrap CLI app, choose one of the following installation methods:

  • Homebrew (macOS / Linux):

brew install mailtrap/cli/mailtrap
  • Download binary

Download the latest release from GitHub Releasesarrow-up-right and add it to your PATH.

  • Go install:

go install github.com/mailtrap/mailtrap-cli@latest

Authentication

To validate your token, detect your account ID, and save both to ~/.mailtrap.yaml run the following command:

mailtrap configure --api-token YOUR_TOKEN

Or, you can also use environment variables:

export MAILTRAP_API_TOKEN=your-token

Using the CLI

Then use any of the ~87 commands across 20 resource groups. A few examples:

Every command supports --output json for scripting and CI/CD integration. Shell completion is available for Bash, Zsh, Fish, and PowerShell.

Last updated

Was this helpful?