Search code examples
laravel-5barcode

How to send generated barcode to email in laravel?


I am using milon/barcode and it works fine in Laravel views, but the problems is while I send this view to email using Laravel Mail, it display the black div in my email. please help me how to resolve the issue. thanks

<div class="row">
    <?php echo DNS2D::getBarcodeHTML("4445645656", "QRCODE"); ?>
</div>

Result

the view send to email


Solution

  • DNS2D::getBarcodeHTML is class function which will works inside your Laravel application but when you send this to an email address, this class function is not recognizable outside of your application.

    Solution: Generate your barcode as image inside your application and then attach it to your email content.