What are the potential security risks of not using RFC-compliant mail headers when sending emails in PHP?

When not using RFC-compliant mail headers in PHP, there is a risk of emails being marked as spam or rejected by email servers. This can result in important emails not reaching their intended recipients. To ensure proper delivery and avoid security risks, it is important to follow RFC standards when setting email headers in PHP.

<?php
$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 .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

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