I am sending the email using below code
Mail::send('emails.sample',[],function($message) use($attachment,$filename)
{
$message->subject('PDF is generated !');
$message->from('test@example.com', 'Example');
$message->to('user@gmail.com');
$message->attachData($attachment,$filename,array('mime'=>'application/pdf','Content-Disposition'=>'attachment'));
});
but after receiving the email, sender email address is coming like this
test=example.com@mailgun.org on behalf of Example test@example.com
but it should be like either email address
or name
test@example.com
How do I fix this? any suggestions, please!