【发布时间】:2015-03-24 22:44:50
【问题描述】:
所以我阅读了关于在 Laravel 中发送邮件的 documentation 和 tutorials,但我似乎无法弄清楚出了什么问题。邮件没有发送,但它也没有给我一个错误。
这是我用来发送邮件的代码:
$data=array(
'id'=>1
'email'=>'myemail@email.com',
'name'=>'test'
);
Mail::send('emails.mail', $data, function($message) use ($data)
{
$message->from('test@test.com', 'me');
$message->to($data['email'],$data['name'])->subject('id: '. $data['id'] );
});
当然'email'=>'myemail@email.com' 被我的邮箱代替了。
我的config/mail.php:
return array(
'driver' => 'mail',
'host' => '',
//etc I didn't change the rest
);
emails.mail 视图:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
</head>
<body>
<h2>Hello {{$name}}</h2>
<p> ID: {{$id}}</p>
</body>
</html>
我不知道我在这里做错了什么。视图运行得很好。我在这里做错了什么?
【问题讨论】: