Laravel Class mailer does not exist

感情迁移 提交于 2019-12-07 10:20:26

问题


I updated my application from 5 to 5.2. Now when I call Mail::send() it return an exception Class mailer does not exist.

Mail::send('emails.mail', ['data' => $content], function ($m) use ($to, $subject,$toname) {

            $m->to($to, $toname)->subject($subject);


        });

When I open Illuminate\Support\Facades\Mail class there is only one function

protected static function getFacadeAccessor()
{
    return 'mailer';
}

Please help. If anyone have any idea


回答1:


Yes, I found the solution just put Illuminate\Mail\MailServiceProvider::class, in app.php providers




回答2:


Sometimes php artisan config:clear must be run in order to get rid of that kind of errors ("Class mailer does not exist").

I've migrated my project 1:1 (code, config, vhost) from old laptop to new one (Windows->Ubuntu) and I couldn't run the app without clearing config's cache.




回答3:


Check where is you call \Debugbar::enable();, it happens when you enable debugbar in register method of service provider.



来源:https://stackoverflow.com/questions/38503654/laravel-class-mailer-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!