Why is it recommended to use PHP tags instead of code tags when outputting variables in email headers?

When outputting variables in email headers, it is recommended to use PHP tags (`<?php ?>`) instead of code tags (`<? ?>`) because PHP tags ensure that the variable values are properly evaluated and inserted into the headers. Using code tags may not always work as expected and can lead to errors or security vulnerabilities in the email headers.

// Incorrect way using code tags
$to = &quot;recipient@example.com&quot;;
$subject = &quot;Hello&quot;;
$headers = &quot;From: &lt;?php echo $email; ?&gt;&quot;;

// Correct way using PHP tags
$to = &quot;recipient@example.com&quot;;
$subject = &quot;Hello&quot;;
$headers = &quot;From: &quot; . $email;