we updated our version of PHP and now we get the error message "Warning: mail (): multiple or incorrect newline characters found in extra_header".
I created experiments with different things, but did not get anything to work. I apologize because I am not very familiar with how this all works, so please bear with me.
The goal (which worked in earlier versions) is to send an HTML-based message (yes, tags, etc.), which includes a PDF attachment existing on our server.
If you can give me some adjustments, I would really appreciate it!
$sFrom = "[Company Name] <[Our Email]>";
$sReplyTo = "[Our Email]";
$sParams = "-f [Our Email]";
$attachment = chunk_split(base64_encode(file_get_contents($sPath)));
$uid = md5(uniqid(time()));
$sHeaders = "From: ".$sFrom."\n".
"Reply-To: ".$sReplyTo."\n".
"MIME-Version: 1.0\n".
"Content-Type: multipart/mixed; boundary=\"".$uid."\"\n\n".
"This is a multi-part message in MIME format.\n".
"--".$uid."\n".
"Content-Type: text/html; charset='iso-8859-1'\n".
"Content-Transfer-Encoding: 7bit\n\n".
$sMessage."\n\n".
"--".$uid."\n".
"Content-Type: application/pdf; name=\"".$sFileName."\"\n".
"Content-Transfer-Encoding: base64\n".
"Content-Disposition: attachment; filename=\"".$sFileName."\"\n\n".
$attachment."\n\n".
"--".$uid."--";
if (!mail($sTo, $sSubject, "", $sHeaders, $sParams)) {
$bError = true;
}
source
share