I am generating the pdf with the previous library is generated without problem and everything, like phpmailer is sent correctly without any problem but when the email arrives the pdf is empty, and at the time of opening it marks me not Is it decoded correctly, any advice regarding this?
I'm using this code ...
include(dirname('__FILE__').'/res/cotizacion_html.php');
$content = ob_get_clean();
try
{
// init HTML2PDF
$html2pdf= new HTML2PDF('P', 'LETTER', 'es', true, 'UTF-8', array(0, 0, 0, 0));
// display the full page
$html2pdf->pdf->SetDisplayMode('fullpage');
// convert
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
// send the PDF
ob_end_clean();
$html2pdf->Output('Cotizacion.pdf');
}
catch(HTML2PDF_exception $e) {
echo $e;
}
//utilizando phpmailer
$mail = new PHPMailer();
$mail->setFrom('[email protected]', 'COTIZADOR ONLINE');
$mail->addAddress('[email protected]', 'DEMSA VENTAS');
$mail->Subject = 'COTIZACION NUEVA';
$mail->addStringAttachment($html2pdf, 'Cotizacion.pdf');
$mail->Body = 'ESTA ES SU NUEVA COTIZACION';'