Do we need to use quotes in $to
and in from/cc/bcc
mail headers when using PHP mail function?
I mean, let's say I want to send mail to:
User One <[email protected]>
Do I have to call:
mail("\"User One\" <[email protected]>", ...
OR
mail("User One <[email protected]>", ...
I suppoose once you give me an answer for the $to
, it is going to be the same for other mail headers, that I normally add in this way:
$mail_headers = "From: " . $from . "\r\n";
$mail_headers .= "Cc: " . $cc . "\r\n";
$mail_headers .= "Bcc: " . $bcc . "\r\n";
$mail_headers .= "MIME-Version: 1.0\r\nContent-type: text/plain;\r\n\tcharset=\"Windows-1252\";\r\nContent-Transfer-Encoding: 8bit" . "\r\n";
//I use "Windows-1252" charset, cause "iso-8859-1" DOES NOT DISPLAY EURO CHAR!
mail($to, $subject, $body, $mail_headers);
Maybe I need to use quotes in case there is a single quote in header? I don't know sometimes I saw examples with quotes, other time without them, does anyone know, and maybe explain.
Thanks!