Laravel mail to a local inbox, three .env lines
To send a Laravel test email without reaching a real inbox, set three lines in .env: MAIL_MAILER=smtp, MAIL_HOST=127.0.0.1, MAIL_PORT=1025. Every email your app sends then lands in Buggregator, with the HTML preview, attachments and raw source. Nothing is delivered.
Steps
1. Start Buggregator
Run the container. Port 8000 is the web UI, port 1025 is the SMTP server.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-p 127.0.0.1:1025:1025 \
-p 127.0.0.1:9912:9912 \
-p 127.0.0.1:9913:9913 \
ghcr.io/buggregator/server:latest2. Change three lines in .env
Point Laravel's SMTP mailer at Buggregator. No username or password is needed.
# .env
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=10253. Use the service name in Docker Compose
If your Laravel app and Buggregator run in the same Compose stack, use the service name as the host.
# SMTP — email capture
MAIL_HOST=buggregator
MAIL_PORT=10254. Send an email and open it
Trigger any email: a registration confirmation, a password reset, a notification. Open http://127.0.0.1:8000. You see the rendered HTML with a Desktop / Tablet / Mobile width switcher, the plain text version, the addresses, the attachments and the raw MIME source.
Why it works
Buggregator includes a fake SMTP server on port 1025. Laravel's SMTP mailer delivers to it like to any mail server, and Buggregator stores the email and shows it in the UI instead of sending it on. Your mail code does not change, only the address in .env.
Related tips
- Mail
Symfony Mailer to a local inbox, one line
Set MAILER_DSN=smtp://127.0.0.1:1025 in your .env and every Symfony email lands in Buggregator with HTML preview and raw source.
- Mail
Catch dev email in docker-compose with one service
Add Buggregator as a service in docker-compose.yml and set your app's mail host to its service name. Every email lands in the UI on port 8000.
- Mail
Check an HTML email at phone width before it ships
Send your app's email to Buggregator on port 1025, then switch the HTML preview between Desktop, Tablet and Mobile width. Nothing reaches a real inbox.
- Mail
Wait for the confirmation email in an E2E test
Call /api/smtp/messages/wait from your E2E test. It returns the matching email as soon as it arrives, or 408 on timeout. No fixed sleeps.
Checked on with Buggregator v2.8.0