Mail attachData of PDF breaks html styling

Posted 2 years ago by rene


This is my code:

$pdf = PDF::loadView('pdf.invoice', ['invoice' => $invoice]);
       Mail::send('emails.invoice', $data, function ($m) use ($user, $pdf, $data) {
            $m->to($user->email, $user->full_name)->subject($data['title']);
            $m->attachData($pdf->output(), $order->invoice_number.'.pdf',  ['Content-Type' => 'application/pdf']);

This does attaches the PDF in the correct way, but the e-mail itself misses the styling.

This is the source of the email itself:

What's going wrong?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.