What are you looking for?
What are you looking for?
When developing a Laravel project, testing email functionality locally can be tricky — especially when you don't want to send real emails during development. That’s where Mailpit comes in. It’s a lightweight, fast, and modern local SMTP testing tool that captures outgoing emails and displays them beautifully in a web interface.
Mailpit allows you to test, preview, and debug emails from your Laravel app without actually sending them. It acts as a fake SMTP server, catching all outgoing messages for local inspection. Perfect for developers who need to verify templates, email content, and configurations.
✅ No need for internet or external SMTP
✅ Instant email preview via browser
✅ Works perfectly with Laravel’s MAIL_* configuration
Mailpit is a single executable file — no installation required. You just download and run it. Follow these steps:
# Step 1: Download Mailpit for Windows https://github.com/axllent/mailpit/releases # Step 2: Open CMD in the folder where mailpit.exe exists cd path\to\mailpit\folder # Step 3: Run Mailpit mailpit.exe
Once Mailpit is running, open your browser and visit:
http://localhost:8025/
You’ll now see the Mailpit dashboard, ready to capture emails sent from your Laravel app.
Now that Mailpit is running locally, update your .env file to send all emails through it:
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="test@example.com"
MAIL_FROM_NAME="${APP_NAME}"
This configuration tells Laravel to send all emails through the local Mailpit SMTP server instead of external ones like Gmail or Mailgun.
After updating your .env file, clear and rebuild Laravel’s configuration cache:
php artisan optimize
To confirm your Mailpit setup works, send a test email using Laravel Tinker:
php artisan tinker
> Mail::raw('Hello from Mailpit', function($m) {
> $m->to('someone@example.com');
> $m->subject('Mailpit Test');
> });
If everything is configured correctly, open http://localhost:8025/ — you’ll see your test email instantly.
Once you refresh Mailpit’s web interface, you’ll see your captured email with subject, body, headers, and even HTML preview. This makes it super easy to validate email designs and content before deploying your Laravel project.
Using Mailpit with Laravel is one of the simplest ways to test email functionality locally. It’s fast, lightweight, and doesn’t require any configuration beyond your .env file. Whether you’re debugging a notification, testing templates, or verifying a password reset email — Mailpit makes it seamless.