I am using Laravel 6.2 now. I am sending the email using below code.
Mail::send('emails.sample',[],function($message) use($subject)
{
$message->subject($subject);
$message->from('[email protected]', 'supplier');
$message->to('[email protected]'); // or [email protected]
});
My .env is the following.
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.myhost.server.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=password
[email protected]
MAIL_FROM_NAME=supplier
And config/mail.php is the following
'from' => [
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
'name' => env('MAIL_FROM_NAME', 'supplier'),
],
but after receiving the email, sender email address is coming like this
supplier <[email protected]>
As you see, changed sender name. but didn't changed sender email.
It should be supplier <[email protected]>
.
How do I fix this? Any suggestions, Please!
King Regards!!!