How to set gmail configuration for mail in Laravel?

Today now in this tutorial i will show you how to set gmail configuration for mail in laravel application. If we are working on laravel and some time we need to setup gmail configuration for send email. So if we want to set configuration of gmail then at first go to mail.php file, we are work on laravel any version its not issue, because we can set it common setting for both version of laravel framework.

'driver' => smtp,
    'host' =>,
    'port' => 587,
    'from' => ['address' => '', 'name' => 'Test'],
    'encryption' => tls,
    'username' =>,
    'password' => test123,
    'sendmail' => '/usr/sbin/sendmail -bs',
    'pretend' => false,

So on this way we can set our gmail account details and it can try this but if we still find error then we have problem security. So we have open this link :

Then check on Turn On

Read Also : How to count number of files in folder and remove all files in folder in laravel example?

Thanks for read this, I hope it will you. You can also follow us on Facebook.


About Shahriar Sagor

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by Shahriar Sagor →