What are the best practices for ensuring consistent line break characters in PHP email messages?

In PHP email messages, ensuring consistent line break characters is important for maintaining the readability and formatting of the email content across different email clients. To ensure consistent line breaks, it is recommended to use the PHP_EOL constant which represents the correct line break character for the current platform. By using PHP_EOL, you can ensure that line breaks are consistent regardless of the operating system.

// Set the MIME type and character set
$headers = "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-type: text/html; charset=UTF-8" . PHP_EOL;

// Define the email content
$message = "Hello, this is a test email." . PHP_EOL;
$message .= "This is a new line in the email content.";

// Send the email
mail("recipient@example.com", "Subject", $message, $headers);