What Mailpit does
Mailpit is an SMTP server for testing with a web UI and an API, shipped as one binary or a Docker image. By default it listens for SMTP on port 1025 and serves the UI and API on 8025. Point your app's SMTP settings at it and every email shows up there, never reaching a real recipient unless you turn on its relay or forwarding.
What it can't see
- Mail sent through a provider's API. If the app calls the provider over HTTPS rather than SMTP, nothing passes through Mailpit unless you add a separate SMTP transport for tests, which is then a different code path from production.
- Provider-side templates. When the provider renders the template from data you send, the email Mailpit could show is not the one users receive.
- What the provider changes. Click-tracking redirects, added headers, DKIM signatures.
- Delivery itself. A suspended account, a sandbox flag left on, a domain that fails authentication: all invisible locally.
Use both
The test code can stay the same in both places if the "read the latest email for this address" step sits behind one small function with two implementations.