因此,我第一次尝试了Laravel mailer,但是我遇到了一些问题,而不是普通的php mail(),后者只发送邮件。
我的拉拉密码:
if(Mail::send('pages/mail', $data, function($message)
{
$message->from('webmaster@example.com', Input::get('name'));
$message->to('nobody@example.com')->subject('Welcome to My Laravel app!');
}))
{
return "success";
}
else
{
return Mail::failures();
}我的拉拉错误反应:
"["nobody@example.com"]"(基本上是我在to()中输入的邮件地址。
如果我使用普通的php mail(),它发送邮件时没有出错(它只进入我的垃圾邮件文件夹,但它只是一个测试)。
知道有什么问题吗?
发布于 2014-09-24 10:26:47
确保在config/mail.php中使用正确的邮件驱动程序
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
*/
'driver' => 'mail',https://stackoverflow.com/questions/26013784
复制相似问题