Sending multiple files in email using PHP

<?php // array with filenames to be sent as attachment $files = array(“emi_pdf/Self_Employee_1330438553.pdf”, “emi_pdf/Self_Employee_1330439327.pdf”,”emi_pdf/Self_Employee_1330438611.pdf”); // email fields: to, from, subject, and so on $to = “abc.kumar@gmail.com”; $from = “me@domain.com”; $subject = “send email with pdf attachment”; $message = “<p>Please see the attachment.</p>”; $headers = “From: $from”; // boundary $semi_rand = md5(time()); $mime_boundary = “==Multipart_Boundary_x{$semi_rand}x”; // … Read more

Generate a PDF and send as attachment in Email

One way: In PHP // download fpdf class (http://fpdf.org) require(“/fpd/fpdf.php”); // fpdf object $pdf = new FPDF(); // generate a simple PDF (for more info, see http://fpdf.org/en/tutorial/) $pdf->AddPage(); $pdf->SetFont(“Arial”,”B”,14); $pdf->Cell(40,10, “this is a pdf example”); // email stuff (change data below) $to = “target@domain.com”; $from = “me@domain.com”; $subject = “send email with pdf attachment”; $message … Read more