dev.vitelline.net

php: mail() error: Multiple or malformed newlines found in additional_header

After updating php version.

Test code that fixed the error:

<?php
$to = “liudmyla.vitel@gmail.com”;
$subject = “Test mail”;
$message = “Здравствуйте! Это простое сообщение электронной почты.”;
$from = “admin@jodis-us.com”;
//$headers = “От: “.$from;
$replyto = “dev.vitelline@gmail.com”;
$from_name = “Liudmyla Vitel”;
$headers = “From: “.$from_name.” <“.$from.”>\n”;
$headers .= “Reply-To: “.$replyto.”\n”;
$headers .= “MIME-Version: 1.0\n”;
mail($to,$subject,$message,$headers);
echo “Mail Sent.”;
?>

  1. Save it in testemail.php, server root
  2. Run https://mysite/testemail.php.

Additional info here:

https://stackoverflow.com/questions/30887610/error-with-php-mail-multiple-or-malformed-newlines-found-in-additional-header

Leave a Reply

Your email address will not be published. Required fields are marked *