Get started with Laravel 4.2 I tried to send an email using the Gmail STMP server. Below is my application /config/mail.php.
return array(
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'from' => array('address' => 'sample_address@gmail.com', 'name' => 'Sample'),
'encryption' => 'tls',
'username' => 'sample_address@gmail.com',
'password' => 'sample password',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
Below is my PHP code.
<!-- app/views/emails/welcome.php -->
Mail::send('emails.welcome', 'Laravel Admin', function($msg) {
$msg->from('sample_address@gmail.com', 'Laravel Admin');
$msg->to('sample_receiver@gmail.com');
});
But that will not work. I have already configured my XAMPP php.ini on my OSX MAC. It only works when sending regular PHP mail, not SMTP. The error message I received from Laravel on the watch page is " Error in the exception handler ." I would like to see more error information, but I do not know how to get additional information. What is wrong with my code? What else do I need to do or customize? Thank!
source
share