Published in: PHP
$to = ; $from = ; $subject = ; $message = ; $headers = "From: $from"; // Generate a boundary string $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // Add a multipart boundary above the plain message $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $data = $output ; // Base64 encode the file data // Add file attachment to the message $message .= "--{$mime_boundary}\n" . "Content-Type: xml;\n" . " name=\"segala.rdf\"\n" . "Content-Disposition: attachment;\n" . " filename=\"segala.rdf\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n";
You need to login to post a comment.
