Are there best practices for handling line breaks in plaintext emails in PHP?

When sending plaintext emails in PHP, it is important to handle line breaks properly to ensure readability across different email clients. One best practice is to use the PHP_EOL constant to insert the appropriate line break based on the operating system the script is running on. This ensures that line breaks are consistent and compatible with various email clients.

// Example of handling line breaks in plaintext emails
$message = "Hello, this is a plaintext email." . PHP_EOL;
$message .= "This is a new line.";

// Send email
$to = "recipient@example.com";
$subject = "Test Email";
$headers = "From: sender@example.com";
mail($to, $subject, $message, $headers);