PHP und Mail Multiple or malformed newlines found in additional header
Hallo,
ich habe schon mehrere Links in Google versucht, aber irgendwie bin ich nicht auf die funktionstüchtige Lösung gekommen.
PHP Version: PHP 5.6.14-0+deb8u1
Fehlermeldung: Warning: mail(): Multiple or malformed newlines found in additional_header
Ich hatte auf dem alten Server PHP 5.3, dort ging das Mail-Script noch.Jetzt aufgrund einer änderung von PHP nicht mehr.
Hat jemand eine Idee, wie ich das Script wieder funktionstüchtig machen kann?
ich habe schon mehrere Links in Google versucht, aber irgendwie bin ich nicht auf die funktionstüchtige Lösung gekommen.
PHP Version: PHP 5.6.14-0+deb8u1
Fehlermeldung: Warning: mail(): Multiple or malformed newlines found in additional_header
Ich hatte auf dem alten Server PHP 5.3, dort ging das Mail-Script noch.Jetzt aufgrund einer änderung von PHP nicht mehr.
Hat jemand eine Idee, wie ich das Script wieder funktionstüchtig machen kann?
$headers = "From: " . $email . "\n";
$headers .= "Reply-To: " . $email;
$boundary = md5(uniqid(time()));
$headers .= "\n";
$headers .= "MIME-Version: 1.0";
$headers .= "\n";
$headers .= "Content-Type: multipart/mixed; boundary=" . $boundary;
$headers .= "\n\n";
$headers .= "This is a multi-part message in MIME format\n";
$headers .= "--$boundary";
$headers .= "\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
$headers .= "Content-Transfer-Encoding: 8bit\n\n";
$headers .= $message;
$headers .= "\n";
$headers .= "--$boundary";
$headers .= "\n";
$headers .= "Content-Type: image/pdf; name=" . basename($file) . "\n";
$headers .= "Content-Transfer-Encoding: base64\n";
$headers .= "Content-Disposition: attachment; filename=" . basename($file) . "\n\n";
$filedata = fread(fopen($file, 'r'), filesize($file));
$headers .= chunk_split(base64_encode($filedata));
$headers .= "\n";
$headers .= "--$boundary--";
mail($to, $subject, $message, $headers);
?>
Please also mark the comments that contributed to the solution of the article
Content-Key: 293563
Url: https://administrator.de/contentid/293563
Printed on: April 25, 2024 at 12:04 o'clock
2 Comments
Latest comment