0

My controller is

public function basic_email() { $data = array('name'=>"Virat Gandhi",'roll'=>"123"); Mail::send(['text'=>'mail'], $data, function($message) { $message->to('[email protected]', 'Basil Baby')->subject ('Laravel Basic Testing Mail'); $message->from('[email protected]','Virat Gandhi'); }); echo "Basic Email Sent. Check your inbox."; 

}

My blade is

Hi, {{ $name }} your roll number is {{$roll}} please click on the link to <a href="#">verify your account</a> 

Mail is being received. but the mail body is displaying html content as such. How to make verify you account a html link in mail body

1

2 Answers 2

1

Change your key text to html in your send function. text key send data as a plain text

Mail::send( ['html' => 'mail']... 

Also change {{}} to {!! !!}

Reference: Laravel -> Mail

Sign up to request clarification or add additional context in comments.

Comments

0

If you are trying to verify registered users, I would suggest you to use Laravel's build-in verification system. You can follow the link: Laravel email verification

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.