laravel mail方法'到'在课堂上找不到

时间:2014-07-05 06:26:49

标签: php email laravel laravel-4

我正在关注phpacademy的 Laravel 4身份验证教程系列,并在电子邮件部分遇到了绊脚石(第6部分,共16部分)。

我在phpstorm中完成此操作,从https://gist.github.com/barryvdh/5227822安装 _ide_helper.php


当我在 HomeController.php 文件中使用 Mail :: send 方法时,代码帮助程序返回以下错误消息。

method "to" not found in class

进一步解释

Referenced method not found in subject class

非常感谢能够解决这个问题的正确方向


以下是HomeController类的完整代码,包括导致问题的Mail:send方法:

class HomeController extends BaseController
{
    public function home()
    {
        Mail::send('emails.auth.test', array('name'=>'User'), function($message)
    {
        $message->to('user@gmail.com','User')->subject('Test');
    });
    }
}

1 个答案:

答案 0 :(得分:0)

我遇到了这个问题,它配置错误了mail.php。检查您的mail.php配置,尝试使用telnet或其他工具来验证您的凭据(如果使用STMP。

相关问题