> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/email-sandbox/local.md).

# Mailtrap Local

Mailtrap Local is the free, open-source local version of [Mailtrap Email Sandbox](/email-sandbox/overview.md). It lets you capture and inspect emails entirely on your own machine during development. It combines a local SMTP server, web interface, and REST API into a single self-contained binary - no account, cloud setup, or additional dependencies required.&#x20;

Mailtrap Local is designed for development and testing only. When you need to collaborate with teammates, you can send captured messages to Mailtrap Email Sandbox using Send to Cloud.

Mailtrap Local is fully open source: [GitHub repository](https://github.com/mailtrap/mailtrap-local).&#x20;

Once running, Mailtrap Local gives you a web interface to browse and search captured messages and inspect each one in full: rendered HTML and plain-text versions, headers, raw source, and attachments. It also runs an HTML Check that flags compatibility issues across major email clients (Outlook, Gmail, Apple Mail, and others), so you catch rendering problems before release.

### Mailtrap Local is commonly used for:

<i class="fa-hand-back-point-right">:hand-back-point-right:</i> **Local email development** - Test email-sending features without sending messages outside your development environment.

<i class="fa-hand-back-point-right">:hand-back-point-right:</i> **Email debugging** - Reproduce and troubleshoot email-related issues locally before deploying changes.

<i class="fa-hand-back-point-right">:hand-back-point-right:</i> **Template development** - Preview and iterate on email templates built with React Email, MJML, Handlebars, or other templating frameworks.

<i class="fa-hand-back-point-right">:hand-back-point-right:</i> **CI testing** - Run automated email tests in CI environments without connecting to a real email provider.

<i class="fa-hand-back-point-right">:hand-back-point-right:</i> **AI agent development** - Catch unintended emails generated by local AI agents before they reach real recipients.

In addition to local email capture, Mailtrap Local lets you:

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><em><strong>Send to Cloud</strong></em></td><td>Promote any captured email to Mailtrap Email Sandbox so teammates can review it without accessing your local environment</td></tr><tr><td align="center"><em><strong>Auto Relay</strong></em></td><td>Forward captured emails through Mailtrap SMTP or any external SMTP provider, such as SendGrid, Mailgun, Amazon SES, or Postmark, when you need to verify delivery in a real inbox</td></tr></tbody></table>

### How it works

Install Mailtrap Local via Homebrew or Docker, or grab a prebuilt binary from the <a href="https://github.com/mailtrap/mailtrap-local/releases" class="button secondary medium">Releases page</a>Then start it:

```
mailtrap-local
```

By default, Mailtrap Local listens for SMTP traffic on `localhost:3535` and serves a web interface at `localhost:3550`. Configure your application to use the local SMTP server, and every outgoing email will be captured instead of being delivered. You can then open the web interface to inspect each message.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mailtrap.io/email-sandbox/local.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
