What potential issues can arise when using CRLF (\r\n) instead of just LF (\n) in PHP email headers?

Using CRLF (\r\n) instead of just LF (\n) in PHP email headers can cause compatibility issues with some email servers that only recognize LF (\n) as the line ending. To solve this problem, you can use the PHP_EOL constant, which represents the correct line ending for the current platform.

<?php
$to = 'recipient@example.com';
$subject = 'Test Email';
$message = 'This is a test email.';
$headers = 'From: sender@example.com' . PHP_EOL;
$headers .= 'Reply-To: sender@example.com' . PHP_EOL;

mail($to, $subject, $message, $headers);
?>