I have successfully generated a PDF using mpdf, which I have verified by downloading the PDF. However, when I send the PDF as an e-mail attachment I receive a blank PDF with
If you can use swiftmailer, you can attach a MPDF generated PDF to the email, quite easily as follows:
setUsername($smtp_username')
->setPassword($smtp_password');
$mailer = Swift_Mailer::newInstance($transporter);
$message = Swift_Message::newInstance('Email Subject')
->setFrom(array($from_email => $from_name))
->setTo($to_email)
->setBody($email_body);
$attachment = Swift_Attachment::newInstance($mpdf->Output($pdf_path, "S"), $pdf_file_name, 'application/pdf');
$message->attach($attachment);
$message->setContentType("text/html");
$result = $mailer->send($message);
?>
Here is the Reference.