How to Send Mail in PHP Laravel?

How to Send Mail in PHP Laravel?

In this post we will give you information about How to Send Mail in PHP Laravel?. Hear we will give you detail about How to Send Mail in PHP Laravel?And how to use it also give you demo for it if it is necessary.

Laravel 5 provide several way to send email. You can also use core PHP method for send mail and you can also use some email service providers such as sendmail, smtp, mandrill, mailgun, mail, gmail etc. So you can choese any one and set configration. Laravel 5 provide Mail facade for mail send that have sevaral method for send email.In this example i going to show you how to send emails from gmail account example. This example is very simple you can use as requirement easily. It is very simple to configration with gmail account so first open your .env file and add bellow gmail configration.






Now we are ready to send mail for test so first create test route for email sending.


Route::get('mail', 'HomeController@mail');

Ok, now add mail function in HomeController.php file so add this way :


public function mail()


$user = User::find(1)->toArray();

Mail::send('emails.mailExample', $user, function($message) use ($user) {


$message->subject('E-Mail Example');


dd('Mail Send Successfully');


At last create email template file for send mail so let’s create mailExample.blade.php file in emials folder.


Also see:Laravel Mailchimp api integration from scratch with example

Hello {{ $name }}, I am from

If you still found any error then follow this link : How to set gmail configration for mail in Laravel?.


Hope this code and post will helped you for implement How to Send Mail in PHP Laravel?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

57  +    =  61

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US