Mailpit
Email testing with web UI
Email testing server with a web interface. Catches all outgoing emails in development without sending real emails.
Docker Configuration
Image: axllent/mailpit:latest
Ports:
- 1025:1025 # SMTP
- 8025:8025 # Web UIDAMP identifies the service using Docker labels. Container name is auto-generated by Docker. Mailpit does not use persistent storage - emails are ephemeral.
Port Configuration
Default ports:
- SMTP:
1025(host) →1025(container) - Web UI:
8025(host) →8025(container)
If either port is occupied on the host machine, DAMP automatically uses the next available port. Check the DAMP interface to see the actual ports assigned.
Environment 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
From Host Machine (Windows)
Web Interface:
Open in your browser:
http://localhost:8025SMTP Server:
Host: localhost
Port: 1025 (or actual port shown in DAMP)From Project Containers
Use the container name or ID shown in the DAMP interface.
SMTP Server:
Host: [container-name]
Port: 1025 (internal port)Laravel .env Configuration:
MAIL_MAILER=smtp
MAIL_HOST=[container-name]
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"Replace [container-name] with the actual container name displayed in DAMP.
Testing Email
Send Test Email
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.
Test User Registration Emails
// Send welcome email
$user->sendEmailVerificationNotification();
// Check Mailpit to see the verification linkTest Password Reset
Password::sendResetLink(['email' => 'user@example.com']);
// View the reset link in MailpitTest Notifications
$user->notify(new OrderShipped($order));
// Preview notification email in MailpitWeb UI Features
- View all captured emails
- Search emails by subject, recipient, or content
- View and download email attachments
- Test responsive email templates
- Dark mode interface
- Bulk delete old test emails
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}