It's been a while everyone! In this short snippet, we'll be going through on setting up Mailpit for Laravel 10 development. Let's get started.
"Mailpit is a multi-platform email testing tool & API for developers. It acts as both an SMTP server and provides a web interface to view all captured emails. It also contains an API for automated integration testing."
To install Mailpit on macOS you can use HomeBrew. First, tap in to "axllent/apps".
What is Mailpit?
"Mailpit is a multi-platform email testing tool & API for developers. It acts as both an SMTP server and provides a web interface to view all captured emails. It also contains an API for automated integration testing."
Install Mailpit via HomeBrew
To install Mailpit on macOS you can use HomeBrew. First, tap in to "axllent/apps".
brew tap axllent/apps
Then you can run the following command to install Mailpit
brew install mailpit
Install Mailpit with Curl for Mac or Linux
If you are not using HomeBrew you can make use of the "curl" command which also supports Linux.
sudo bash < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh)
Install from Release for All Platform
Other than the 2 installation methods above, you may also download the release and install it. Mailpit from release.
Update environment file for Laravel
Finally you need to update the Laravel environment configuration as follows.
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"