Mailpit

Mailpit is a self-hosted email and SMTP testing tool. It can be used to capture, inspect, and analyze email messages sent from your application.

Installation

To access Mailpit, you can use the following URL:

Mailpit URL

https://mailpit.dev.test/

Mailpit UI

Important notes

  • Mailpit is only available in development mode.
  • Be sure to configure your hosts file to support mailpit.dev.test so that you can access the Mailpit UI.
  • If you run spin up and see a 404 immediately after bringing the services up, wait at least 15 seconds and try again. The mailpit container needs time to start up.

Configuration

To use Mailpit with Laravel, you need to ensure your .env file has the following configuration:

.env Configuration

MAIL_MAILER=smtp # For Laravel 11+
MAIL_DRIVER=smtp # For Laravel 10↓
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=