Email PDF Attachment with PHP Using FPDF
I want to email a PDF as an attachment that was created using FPDF. My code looks like this, but the attachment never comes through. <?php require('lib/fpdf/fpdf.php'); $pdf = new FPDF('P', 'pt', array(500,233)); $pdf->AddFont('Georgiai','','georgiai.php'); $pdf->AddPage(); $pdf->Image('lib/fpdf/giftcertificate.jpg',0,0,500); $pdf->SetFont('georgiai','',16); $pdf->Cell(40,10,'Hello World!'); $doc = $pdf->Output('test.pdf', 'S'); //define the receiver of the email $to = 'myemail@example.com'; //define the subject of the email $subject = 'Test email with attachment'; //create a boundary string.