What are common pitfalls when using PHP mailer for contact forms?

One common pitfall when using PHP mailer for contact forms is not properly setting the 'From' address, which can lead to emails being marked as spam. To solve this issue, make sure to set the 'From' address to a valid email address associated with your domain.

// Set the 'From' address
$mail->setFrom('your_email@example.com', 'Your Name');