Home >Backend Development >PHP Tutorial >Why Am I Getting a \'Multiple or Malformed Newlines Found in additional_header\' Error in PHP\'s mail() Function?

Why Am I Getting a \'Multiple or Malformed Newlines Found in additional_header\' Error in PHP\'s mail() Function?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-17 17:40:02778browse

Why Am I Getting a

Multiple Newlines Error in PHP mail() Function

Users have encountered an error while using PHP's mail() function, receiving the message: "Multiple or malformed newlines found in additional_header."

Cause

This error was triggered by a recent update to PHP version 5.5.26. A security vulnerability was addressed, disallowing multiple or malformed newlines in additional_header arguments. This prevents malicious actors from injecting additional messages through headers.

Solution

To resolve this error, follow these steps:

  • Sanitize Headers: Ensure that your additional_header parameters do not contain multiple newlines. Invalid combinations include rr, r

The above is the detailed content of Why Am I Getting a 'Multiple or Malformed Newlines Found in additional_header' Error in PHP's mail() Function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn