$pdf->Cell(0, 5, $employer->get_name(), 1, 0, 'C'); $pdf->Ln(10); $table_header = array("No.", "Item", "Amount (" . $currency . ")"); $pdf->FancyTable($table_header); $pdf->Ln(13); $pdf->SetFont('', 'I'); $pdf->Cell(0, 0, "This credit note was automatically generated. Signature is not required.", 0, 0, 'C'); $pdf->Ln(6); $pdf->Cell(0, 5, "Refund Notice", 'LTR', 0, 'C'); $pdf->Ln(); $pdf->Cell(0, 5, "- Refund will be made payable to " . $employer->get_name() . ". ", 'LR', 0, 'C'); $pdf->Ln(); $pdf->Cell(0, 5, "- To facilitate the refund process, please inform us of any discrepancies.", 'LBR', 0, 'C'); $pdf->Ln(10); $pdf->Cell(0, 0, "E. & O. E.", 0, 0, 'C'); $pdf->Close(); $pdf->Output($GLOBALS['data_path'] . '/credit_notes/' . $filename . '.pdf', 'F'); $attachment = chunk_split(base64_encode(file_get_contents($GLOBALS['data_path'] . '/credit_notes/' . $filename . '.pdf'))); $subject = "Balance Refund Notice of Invoice " . pad($previous_invoice, 11, '0'); $headers = 'From: YellowElevator.com <*****@*****.**>' . "\n"; $headers .= 'Bcc: ' . $sales . "\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-Type: multipart/mixed; boundary="yel_mail_sep_' . $filename . '";' . "\n\n"; $body = '--yel_mail_sep_' . $filename . "\n"; $body .= 'Content-Type: multipart/alternative; boundary="yel_mail_sep_alt_' . $filename . '"' . "\n"; $body .= '--yel_mail_sep_alt_' . $filename . "\n"; $body .= 'Content-Type: text/plain; charset="iso-8859-1"' . "\n"; $body .= 'Content-Transfer-Encoding: 7bit"' . "\n"; $mail_lines = file('../private/mail/employer_credit_note.txt'); $message = ''; foreach ($mail_lines as $line) {