Expected: application/pdf (.pdf); found: text/plain (.txt)
$filenameee = $_FILES['id']['name'];
// main header (multipart mandatory) $headers = "From: ".$fromname." <".$fromemail.">" . $eol; $headers .= "MIME-Version: 1.0" . $eol; $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol; $headers .= "Content-Transfer-Encoding: binary"; $headers .= "This is a MIME encoded message." ; $headers .="Content-Length: . filesize($filenameee)"; $headers .="Accept-Ranges: bytes" ; @readfile($filenameee);
// message //$body = "--" . $separator . $eol; $body .= "Content-Type: text/plain; charset=\"iso-8859-1\"" . $eol; $body .= "Content-Transfer-Encoding: binary" . $eol; $body .= $message . $eol; // attachment $body .= "--" . $separator . $eol; $body .= "Content-Type: application/pdf; name=\"" . $filenameee . "\"" . $eol; $body .= "Content-Transfer-Encoding: binary" . $eol; $body .= 'Content-Disposition: inline; $filenameee="' . $filenameee . '"'; $body .= $content . $eol; $body .= "</tbody></table>";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)