I am using Laravel with Mailable class for sending emails with HTML content it is sending, but I am receiving mail with an email address, but I need a name. Still, it's not helpful. Can anyone explain where I made a mistake?
Mail::html($template,function($message) use($emailid1,$subject,$fromemailname){
$message->subject($subject);
$message->from($fromemailname,'TEST');
$message->to($emailid1);
});
I am expecting an email from TEST. I tried to override the mail config, too, but I am still receiving with an email address only.
The
frommethod of theMessageclass takes two parameters: the email address and the sender's name. You might have swapped the order of these parameters in your code. Make sure the email address comes first, followed by the name.