Laravel Test Email Functionality with MailTrap on Localhost
Email sending is a crucial functionality in our websites. When you develop a Laravel project and want to send emails, Testing in the local environment is difficult. With MailTrap, we can easily test those emails before you go to production. Here are the easy steps you need to follow.
Create a MailTrap Account
First, we need to create a MailTrap account to get our free inbox to test the emails. You can easily create a MailTrap account here. https://mailtrap.io/register/signup?ref=header
You can create a new mailbox after you create a new account and log in to the MailTrap. Inside that, you can see the following screen.
Here the most important is SMTP Settings. So we will use those settings under Laravel, which I have highlighted here.
Create a new Laravel Project.
composer create-project --prefer-dist laravel/laravel:^7.0 test_email