I have the following code which generates a pdf certificate and saves it in a folder.
$this->data['html'] = $html;
$filename = $userid;
$pdfFilePath = FCPATH."assets/downloads/reports/".$filename.".pdf";
$data['page_title'] = 'Certificate'; // pass data to the view
unlink($pdfFilePath);
if (file_exists($pdfFilePath) == FALSE) {
ini_set('memory_limit','32M');
$this->load->library('pdf');
$pdf = $this->pdf->load();
$pdf->SetFooter($_SERVER['HTTP_HOST'].'|{PAGENO}|'.date(DATE_RFC822));
$pdf->WriteHTML($html); // write the HTML into the PDF
$pdf->Output($pdfFilePath, 'F'); // save to file because we can
redirect("assets/downloads/reports/$filename.pdf");
}
else {
echo "Some problem is their, please contact admin regarding this..";
}
$this->load->view('certificate', $this->data);
}
However, I would like to send the same certificate after generation through e-mail to a recipient. What do I need to do?
Regards
Charles
However, I would