i have this code for sending mail from Laravel.This code is perfectly running well.
Mail::send('emails.auth.accept', array(), function($message) {
$message->to('[email protected]', 'abc')->subject('This is a demo!');
});
But i can only be able to send the message using hardcode values such as [email protected].
Whenever I try this.
Mail::send('emails.auth.accept', array(), function($message) {
$message->to($user, $name)->subject('This is a demo!');
});
Above code is giving me error : Undefined variable: user. That means it is not accepting dynamic values. help me.