I am using smtp
driver and this is my code to send email in laravel 5.2:
public function Sendmail()
{
$data["mail_message"] = "Hello!";
if(Mail::send('Emails.email', $data, function($message)
{
$message->from('webmaster@example.com', Input::get('name'));
$message->to('amirhasan.hesam@gmail.com')->subject('Welcome to My Laravel app!');
}))
{
return "success";
}
else
{
return Mail::failures();
}
}
the Mail::failures()
returns ["amirhasan.hesam@gmail.com"]
with no specific error!
and this is my config on mail.php :
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', '*******'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => "****@*****", 'name' => "Diling"],
'encryption' => env('MAIL_ENCRYPTION', ''),
'username' => env('*****@*****'),
'password' => env('*************************'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
and I am using xamp right now to test the email. Any thoughts?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kLjcoo
via IFTTT
Aucun commentaire:
Enregistrer un commentaire