With Mailpit, emails sent from your applications stay on your local machine, allowing you to test without affecting real users.
Mailpit is a multi-platform email testing tool for developers.
It acts as both an SMTP server and provides a web interface to view all captured emails.
Mailpit is inspired by MailHog, but much, much faster.
Follow these steps to integrate Mailpit into your Laragon environment:
1. Download MailPit
Visit the Mailpit GitHub repository and download the latest release for Windows. Look for the mailpit-windows-amd64.zip file in the releases section. Go here - https://github.com/axllent/mailpit/releases/tag/v1.21.0

2. Extract the Zip File
After downloading, open your Downloads folder, locate mailpit-windows-amd64.zip, and extract its contents:
- Right-click on
mailpit-windows-amd64.zip.
- Select “Extract All…” and complete the extraction process.
- Copy the
mailpit-windows-amd64 folder from your Downloads folder.
3. Move Mailpit to Laragon
Go to your Laragon installation directory and navigate to the bin folder. Paste the extracted Mailpit directory here and rename it to mailpit for easier access.

4. Modify the Hosts File
In Laragon, open the hosts file to set up Mailpit’s local domain:
-
Click on the red "H" icon in Laragon (you may need to grant administrator permissions).
-
This opens C:\WINDOWS\system32\drivers\etc\hosts in Notepad++ by default.
-
Add the following line before any Laragon magic comments:
Manual 127.0.0.1 mailpit # Manual for laragon\bin\mailpit\mailpit.exe
-
Save the file and allow elevated privileges if prompted.
5. Configure Autostart
To start Mailpit automatically with Laragon, modify Laragon’s Procfile:
Mailpit.exe : autorun mailpit.exe PWD=C:\laragon\bin\mailpit Mailpit Admin : autorun http://mailpit:8025
Each time you start Laragon, Mailpit will launch automatically in the background, and the Mailpit admin interface will open in your browser.