How to Set Subject In Laravel Mail ?

Laravel 6 , Laravel

Nicesnippets

2273

10-12-2019


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

https://www.nicesnippets.com/blog/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....


Recommended Posts