What potential issues could arise from sending email with PHP without proper mail headers?

Sending emails without proper mail headers can result in emails being marked as spam or not being delivered at all. To ensure proper delivery and avoid being flagged as spam, it is important to include necessary headers such as "From", "Reply-To", and "MIME-Version" in the email.

// Set necessary mail headers
$headers = "From: sender@example.com\r\n";
$headers .= "Reply-To: replyto@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

// Send email with headers
mail($to, $subject, $message, $headers);