# SMTP4dev Guide: Local Email Testing, Limits, and CI Strategy

Use smtp4dev for local email testing, inspect outbound messages safely, and understand where local fake SMTP should be replaced by cloud test workflows.

SMTP4dev catches the emails your app sends during local development, so you can inspect them without filling a customer's inbox. It's handy for checking a template or debugging SMTP settings. Once that local check passes, you'll still want to test what happens when the message leaves your machine.

## Quick answer: when to use smtp4dev

Use smtp4dev for:

- local feature development
- template and header inspection
- quick validation of app SMTP wiring

Do not rely on it alone for:

- inbox placement confidence
- multi-environment release gates
- team-wide shared testing visibility

## What smtp4dev does

- listens as an SMTP endpoint
- accepts test messages
- shows captured mail in a web UI
- prevents accidental sends to real recipients

## Docker quick start

```bash
docker run --rm -it -p 3000:80 -p 2525:25 rnwood/smtp4dev:v3
```

Typical local config:

- host: `localhost`
- port: `2525`
- web UI: `http://localhost:3000`

## Basic verification

```bash
swaks --server localhost:2525 --from test@example.com --to test@local.dev
```

Then confirm message content in smtp4dev UI.

## smtp4dev strengths

1. Very fast setup for local testing.
2. Safe interception of dev/test emails.
3. Useful for debugging message shape and headers.

## smtp4dev limitations

1. Local-only visibility by default.
2. Limited realism vs production delivery path.
3. No full deliverability or policy diagnostics.
4. Can be awkward for CI/CD unless tightly scripted.



### Take your SMTP test beyond localhost

Your local capture looks right. Now send the message to a MailSlurp inbox and check that it arrives with the expected content and a signup link that works.

[Test real email delivery](/product/email-integration-testing/)



## Local fake SMTP vs cloud workflow

| Capability                 | smtp4dev (local) | Cloud test workflow |
| -------------------------- | ---------------- | ------------------- |
| Local dev speed            | Excellent        | Good                |
| Team sharing               | Limited          | Strong              |
| CI integration reliability | Moderate         | Strong              |
| Inbox placement insight    | Weak             | Stronger            |
| Event/webhook validation   | Limited          | Strong              |

## Recommended strategy

Use smtp4dev while you're building the feature, then add checks that exercise the sending path used by your app:

1. local debug in smtp4dev
2. integration assertions in CI
3. event and failure routing checks
4. deliverability and inbox validation

For those checks, start with:

- [Fake SMTP server setup](/blog/fake-smtp-server-setup-for-testing/)
- [Email Sandbox](/product/email-sandbox/)
- [Email integration testing](/product/email-integration-testing/)
- [Email Webhooks](/guides/email-webhooks/)
- [Email deliverability test](/testing/email-deliverability-test/)

## FAQ

### Is smtp4dev good for production validation?

No. It is mainly for local debugging and pre-CI checks.

### Can smtp4dev replace deliverability testing?

No. It does not emulate real mailbox provider filtering and routing behavior.

### Should I use smtp4dev or MailHog/MailCatcher?

Any local fake SMTP can work for local checks; choose based on team workflow and tooling constraints.

## Next steps

- [How to set up a fake SMTP server](/blog/fake-smtp-server-setup-for-testing/)
- [MailHog tutorial](/blog/mailhog-tutorial/)
- [Introduction to MailCatcher](/blog/introduction-to-mailcatcher/)
