September 18, 2014 — kyle.huynh205
Laravel – Swift_TransportException : Cannot send message without a sender address
The reason for this error is about updating setting for app/config/mail.php
in order to suite SMTP information in your Mail::send() implementation. Change the mail settings according to the following:
'host' => 'smtp.gmail.com',
'port' => 465,
'encryption' => 'ssl',
'username' => 'your_username',
'password' => 'your_password',
Then your code should be as simple as:
public function email()
{
Mail::send('emails.auth.mail', array('token'=>'SAMPLE'), function($message)
{
$message->from( Input::get('email'), Input::get('name') );
$message->to('name@gmail.com', 'Name')->subject( Input::get('subject') );
});
}