What potential issues could arise from using the $header variable in the mail() function?
Using the $header variable in the mail() function can potentially lead to security vulnerabilities such as header injection attacks. To prevent this, it is recommended to sanitize and validate the input before using it in the $header variable.
// Sanitize and validate the $header variable before using it in the mail() function
$header = "From: " . filter_var($_POST['from_email'], FILTER_SANITIZE_EMAIL);
$header .= "\r\nReply-To: " . filter_var($_POST['reply_email'], FILTER_SANITIZE_EMAIL);
// Use the sanitized and validated $header variable in the mail() function
mail($to, $subject, $message, $header);