Laravel 5 Mail template showing html tags
To use HTML content from a PHP variable within a .blade.php
file, you need to use {!! $variable !!}
instead of {{ $variable }}
. The first will render your HTML, the second will output it as a string, including the HTML tags. Your mail.blade.php
file should look like:
<table>
<tr>
<td>SiteName</td>
</tr>
<tr>
<td>{!! $content !!}</td>
</tr>
</table>
Use {!! $content !!}
instead of {{ $content }}
It will work perfectly.I had faced the same problem.