What are the custom headers that need to be parsed by PHP when using the mail() function in Windows?

When using the mail() function in PHP on a Windows server, custom headers need to be parsed correctly in order for the email to be sent successfully. One common issue is that the headers may not be formatted correctly, causing the email to not be sent or to be marked as spam. To solve this issue, make sure that the custom headers are formatted properly with "\r\n" at the end of each header line.

$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email.";
$headers = "From: sender@example.com\r\n";
$headers .= "Reply-To: sender@example.com\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();

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