Send PDF in Attachment mPDF, phpmailer

Asked

Viewed 665 times

1

I have the following code in PHP:

error_reporting(E_ALL ^ E_DEPRECATED);
$this->load->helper('mpdf');
$this->data['dadosboleto'] = $this->boleto_model->GerarBoletoCEF($id_cliente, $data_inicial, $data_final);
$this->data['view'] = 'boleto/boleto';
$html = $this->load->view('boleto/boleto_impressao', $this->data, true);
pdf_create($html, 'boleto_'.$id_cliente."_". date('d-m-Y'), true);

I need that instead of generating and forcing the download of PDF (boleto), I would like to send this boleto attached to an email. I just don’t know how to turn it into file, sending I know how to develop.

  • I think it might be a path : http://php.net/manual/en/pdf.examples-basic.php

  • This link does just that. https://gist.github.com/ajitbohra/3eb0296265931ddb4e84

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.