August 1, 2025

Mailpit: Simple Local Email Testing for Laravel

Preview every email sent from Laravel without actually sending it

Tools
Mailpit: Simple Local Email Testing for Laravel

What is Mailpit?

Mailpit is a lightweight tool that runs a local SMTP server and catches any emails your app sends. Instead of delivering emails to real inboxes, it stores them and gives you a clean browser interface to preview them.


Why Use It in Laravel?

  • Prevents sending test emails to real users
  • Lets you preview subject lines, content, headers, and attachments
  • No config for third-party services like Mailgun or SMTP providers
  • Perfect for developing and debugging Mailable classes

Quick .env Setup

MAIL_MAILER=smtp MAIL_HOST=127.0.0.1 MAIL_PORT=1025 MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="test@example.com"

Once configured, open http://localhost:8025 to view sent emails.


That's it—Mailpit helps you test emails safely and instantly while working on your Laravel project.

Did you find this article helpful? Share it!