Hi Team
I am unable to view pdf and below is my logic for attaching pdf, please advice me i have been stuck with this issue for way to long. Advice me how to attach many docs after. When i try to open its said failed to load "Expected: application/pdf (.pdf); found: text/plain (.txt)"
" . $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);
$body .= "Monthly income: {$income} ";
$body .= " ";
$body .= "Town: {$town} ";
$body .= " ";
$body .= "Upload bankstatement {$bankstatement} ";
$body .= " ";
$body .= "Upload payslip: {$payslip} ";
$body .= " ";
$body .= " ";
// 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 .= "";
$body .= "";
?>
Vishal JoshiPosted Mar 13, 2023, 5:10 AM
Hello
Please try below code. You can create attachment array like
Thanks