How to set gmail configuration for mail in Laravel?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

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.

Mail.php
'driver' => smtp,
    'host' => smtp.gmail.com,
    'port' => 587,
    'from' => ['address' => 'test@gmail.com', 'name' => 'Test'],
    'encryption' => tls,
    'username' => test@gmail.com,
    '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 : https://www.google.com/settings/security/lesssecureapps

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 code chef

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 code chef →