Email configuration with Laravel

In this article we will see how you can configure Laravel to send email

I am going to use Free account to test the Email

First thing I am going to add SMTP details to .env file

Then you can create controller to test the email

Now you can create the send action and add the following code to send test email

Now I am going to create the route for the controller action. In your route\web.php file, add the following line

Finally you can create the view for the email body
create welcome.blade.php file inside the views\mails folder and put some text in this file

Now you can test the URL http://localhost/user/public/sendemail
You can see the email in