gmail sending using smtp in laravel
Route::get('sendmail', function()
{
$data = array('name'=>'xxxx');
$mail= Mail::send('emails.sendmail', $data, function($message){
$message->from('example@gmail.com');
$message->to('example@gmail.com')
->subject('hi ra..!!! this is punna rao.');
$display = 'resume';
$message->attach('file_path', ['as' => $display, 'mime' => 'application/pdf']);
});
if($mail)
{
return 'successfully sent';
}
});