How to Set Subject In Laravel Mail ?

Admin   Laravel   572  2021-03-17 04:00:07

Hi Guys,

In this tutorial,I will learn you how to set subject send email using markdown mailable class in laravel. you can simply set the subject in laravel mail.

Click to Mailable class Example

 

laravel-6-send-mail-using-mailable-class

Solution

you can set build() method in mailable class example.

app/Mail/MyTestMail.php

 

/**

* Build the message.

*

* @return $this

*/

public function build()

{

return $this->subject('Your Subject')

->markdown('emails.myDemo')

->attach(public_path('pdf'), [

'as' => 'sample.pdf',

'mime' => 'application/pdf',

]);

}

It will help you....