Skip to main content
Mailpit is a local email testing tool bundled with Bearsampp. Instead of delivering emails to real inboxes, it intercepts all outgoing SMTP messages and displays them in a web-based UI. This lets you test registration emails, password resets, notifications, and any other transactional email your application sends — without ever leaving your local machine or risking sending test messages to real users.

How it works

Mailpit runs as a Windows service that listens on an SMTP port. When your PHP application (or any other local application) sends an email to that port, Mailpit captures it and stores it in an in-memory inbox. You can then open the Mailpit web UI to read the captured messages, inspect headers, and check HTML rendering.

Default settings

PropertyValue
SMTP port1025
Web UIAccessible via tray → Mailpit → Localhost
Service namebearsamppmailpit

Configuring your application

Point your application’s mail settings to Mailpit’s SMTP port. Do not use port 25 — use 1025 (or whichever port you have configured in Bearsampp). For Laravel or Symfony projects, update your .env file:
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
For PHP’s built-in mail() function, configure php.ini to use the SMTP relay:
[mail function]
SMTP = localhost
smtp_port = 1025
You can open php.ini from the tray menu (PHPEdit php.ini), make the changes, and restart Apache.

Viewing captured emails

1

Make sure Mailpit is running

Right-click the tray icon → MailpitStart service if the service is not already active.
2

Send a test email from your app

Trigger an email from your application — for example, submit a registration form or a password reset request.
3

Open the Mailpit web UI

Right-click the tray icon → MailpitLocalhost. The Mailpit inbox opens in your browser showing all captured messages.
Mailpit stores messages in memory. All captured emails are lost when the Mailpit service restarts. If you need to preserve a message, copy its content from the web UI before stopping the service.

Tray menu options

Right-click the tray icon → Mailpit to access:

Start / Stop service

Start or stop the Mailpit Windows service.

Change port

Switch Mailpit’s SMTP port to a different value. Remember to update your application’s mail config to match.

Localhost

Open the Mailpit web UI in your browser to view captured messages.

Logs

Open the Mailpit log file to diagnose connection or startup issues.

Service details

PropertyValue
Service namebearsamppmailpit
Default SMTP port1025
Log filelogs/mailpit.log
Mailpit also exposes an API for inspecting and deleting messages programmatically. This is useful for automated testing — your test suite can send emails and then assert their contents via the Mailpit API.