What are potential security implications of using the ReplyTo option in PHPMailer for email headers?

Using the ReplyTo option in PHPMailer can potentially lead to email header injection attacks, where an attacker can manipulate the ReplyTo address to include malicious content. To mitigate this risk, sanitize and validate the ReplyTo address before setting it in the email headers.

// Sanitize and validate the ReplyTo address
$replyTo = filter_var($replyTo, FILTER_VALIDATE_EMAIL);

// Set the ReplyTo address in the email headers
$mail->addReplyTo($replyTo);