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

After updating php version.

Test code that fixed the error:

$to = “”;
$subject = “Test mail”;
$message = “Здравствуйте! Это простое сообщение электронной почты.”;
$from = “”;
//$headers = “От: “.$from;
$replyto = “”;
$from_name = “Liudmyla Vitel”;
$headers = “From: “.$from_name.” <“.$from.”>\n”;
$headers .= “Reply-To: “.$replyto.”\n”;
$headers .= “MIME-Version: 1.0\n”;
echo “Mail Sent.”;

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

Additional info here:

Leave a Reply

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