Blog Detail Pic

Setup Mail Hog with Laravel

Avatar
by Kwilio | Apr 13, 2021

Mail Hog is the easiest method to test Laravel email function in your test environment. This allows you to 'trap' emails and preview before adding to your production site.

Installation and setup is really simple and I will explain the steps below.

Steps:

1. Install Mail Hog on your computer using brew or other methods.

2. Open your Laravel .env file and make the following changes to the MAIL section.

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null

3. All Set. You can now get your emails from the following link

http://127.0.0.1:8025