Mailpit
Email testing with web UI
Email testing server with a beautiful web interface. Catch all outgoing emails in development without sending real emails.
Default Configuration
Image: axllent/mailpit:latest
Container: damp-mailpit
Ports:
- 1025:1025 # SMTP
- 8025:8025 # Web UI
Network: devnetEnvironment Variables
| Variable | Value | Description |
|---|---|---|
MP_SMTP_BIND_ADDR | 0.0.0.0:1025 | SMTP server address |
MP_UI_BIND_ADDR | 0.0.0.0:8025 | Web UI address |
MP_MAX_MESSAGES | 5000 | Maximum stored messages |
Connection Information
SMTP Server
From Docker Containers:
Host: damp-mailpit
Port: 1025From Host Machine:
Host: localhost
Port: 1025Web Interface
Open in your browser:
http://localhost:8025No Authentication Required
Development environment - SMTP and web UI are open without passwords!
Laravel Configuration
Update your .env file:
MAIL_MAILER=smtp
MAIL_HOST=damp-mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"Test Email Sending
use Illuminate\Support\Facades\Mail;
Mail::raw('Test email content', function ($message) {
$message->to('test@example.com')
->subject('Test Email');
});Check http://localhost:8025 to see your email!
Web UI Features
- 📧 View All Emails - Inbox with all captured emails
- 🔍 Search - Find emails by subject, recipient, or content
- 📎 Attachments - View and download email attachments
- 📱 Mobile View - Test responsive email templates
- 🌓 Dark Mode - Easy on the eyes
- 🗑️ Bulk Delete - Clear old test emails
Common Use Cases
Test User Registration Emails
// Send welcome email
$user->sendEmailVerificationNotification();
// Check Mailpit - see the verification link!Test Password Reset
Password::sendResetLink(['email' => 'user@example.com']);
// View the reset link in MailpitTest Notifications
$user->notify(new OrderShipped($order));
// Preview notification email in MailpitPro Tip
Mailpit saves up to 5,000 messages - perfect for testing bulk email campaigns without cluttering real inboxes!
API Access
Mailpit provides a REST API:
# Get all messages
curl http://localhost:8025/api/v1/messages
# Get specific message
curl http://localhost:8025/api/v1/message/{id}