Laravel SMTP Email
you can put your email and name in Input
Input::merge(array('email'=>'sample_receiver@gmail.com','name'=>'sample_name')); Mail::send('emails.welcome', 'Laravel Admin', function($msg) { $msg->from('sample_address@gmail.com', 'Laravel Admin'); $msg->to(Input::get('email'), Input::get('name'))->subject('You have');});
also change 'encryption'
return array( 'driver' => 'smtp', 'host' => 'smtp.gmail.com', 'port' => 465, 'from' => array('address' => 'sample_address@gmail.com', 'name' => 'Sample'), 'encryption' => 'ssl', 'username' => 'sample_address@gmail.com', 'password' => 'sample password', 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false,);
When you are having problems with sending mails via gmail, try this. It worked for me.
Login with your gmail account and then go to:https://accounts.google.com/b/0/DisplayUnlockCaptcha
and click continue. Then, you have few minutes to send your mail with your code.After this, Google will allow sign in to that account from the new source.