How to Change From Name in Laravel Mail?
In this post, we will learn laravel mail change from the name. I explained simply about how to change from name in laravel mail. This post will give you a simple example of laravel mail change from address. This article will give you a simple example of laravel change from name in email.
If you want to change from name and from address then i will let you know how to change from name and from email in laravel mail. you can use this example with laravel 6, laravel 7, laravel 8 and laravel 9 version.
Yesterday, i write following tutorial about send email with multiple attachment, you can follow this tutorial here: Laravel Send Email with Multiple Attachment Example.
Laravel provides from() where we can change email and name of mail.
We will change the following code on MyTestMail class as follows and you will see how to change from name and address with output.
let's see MyTestMail.php file code as like bellow:
class MyTestMail extends Mailable
use Queueable, SerializesModels;
* Create a new message instance.
* @return void
public function __construct($details)
$this->details = $details;
* Build the message.
* @return $this
public function build()
$address = config("mail.from.address");
$name = 'My Project';
$this->subject('Mail from ItSolutionStuff.com')
I hope it can help you...
We are Recommending you
- Laravel Two Factor Authentication using Email Tutorial
- How to Send Mail using Sendinblue in Laravel?
- How to Send Mail using Mailjet in Laravel?
- Laravel Send Mail using Mailgun Example
- Laravel 8 Mailgun Integration Example
- How to Send Email with Attachment in Laravel?
- How to Generate PDF and Send Email in Laravel?
- How to Send Mail in Laravel 8 using Mailtrap?
- Laravel Send Mail using Mailtrap Example
- Laravel 8 Send Mail using Queue Example
- Laravel Mailgun Setup Example