lundi 22 mai 2017

Laravel 5.1 Mail::send doesn't work - gives 500 internal server error

I took an example from the Laravel 5.1 documentation for Mail and replaced it with my send and receiver email ids.

Mail::raw works in the controller and if I use Mail::send in tinker it works. However, if I use Mail::send in the controller it doesn't work.

Everything is set up as described on the Laravel 5.1 mail page. http://ift.tt/2hmkilE . I have also cleared app cache, config cache and view cache.

public function sendEmailReminder(Request $request, $id)
{
    $user = User::findOrFail($id);
    Mail::send('emails.reminder', ['user' => $user], function ($m) use ($user) {
        $m->from('hello@app.com', 'Your Application');

        $m->to($user->email, $user->name)->subject('Your Reminder!');
    });
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire