Catch Laravel mail locally with Mailpit
Testing password resets and order mails should never reach a real customer. Mailpit is a local mail server with a web inbox: everything your apps send lands there.
Install and start Mailpit
- Open Quick Add and install Mailpit.
- Start it from its card on the Services page, or with Start All.
- Open the inbox from the same card or from the tray.
Point Laravel at it
New Laravel projects from QuickApp are set up already. For an existing one, in .env:
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
Any user name and password are accepted.
Plain PHP and WordPress
PHP's mail() goes to Mailpit too while it runs, so WordPress and other PHP apps need no plugin. Switch that off in Settings › Mail.
Questions
Can mail still reach the internet?
No. Mailpit keeps every message locally; nothing is delivered.
Which port is the inbox on?
SMTP on 1025 and the web inbox on 8025, both on your computer only.
Related guides
-
Run Laravel locally with HTTPS
Set up a Laravel project locally with a real https:// address and a certificate your browser trusts, plus MySQL and Mailpit, on Windows, macOS or Linux.
-
Run PHP 7.4 and PHP 8.4 side by side on Windows
How to run several PHP versions on Windows at the same time, PHP 7.4 to 8.5, and give each project its own version, without editing Apache or nginx configs by hand.