What is the format for e-mail headers that display a name rather than the e-mail?

To have names, as opposed to email addresses shown, use the following:

"John Smith" <[email protected]>

Easy.

Regarding the broken line breaks, that is because you are enclosing the text in apostrophes rather than quotation marks:

$headers = array(
  'From: "The Sending Name" <[email protected]>' ,
  'Reply-To: "The Reply To Name" <[email protected]>' ,
  'X-Mailer: PHP/' . phpversion() ,
  'MIME-Version: 1.0' ,
  'Content-type: text/html; charset=iso-8859-1' ,
  'BCC: ' . $emailList
);
$headers = implode( "\r\n" , $headers );

Leave a Comment