How to Send Mail in PHP Laravel?

By Hardik Savani | April 25, 2016 | Category : Laravel

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.




[email protected]



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


Route::get('mail', '[email protected]');

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.



Hello {{ $name }}, I am from

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


Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: