What is the variable used to set the 'From' name on an email?
Emails sent by my forum site display in the receiver's inbox as 'From: email@address.com'. I want it to display as 'John Doe' (without changing the actual address, of course).
What do I need to add to my mail code?
$headers = 'From: email@address.com \r\n';
Then within your mail()
mail($to, $my_subject, $msg_body, $headers);
That should do the trick.
SpecialFX wrote:$headers = 'From: email@address.com \r\n';
will give him what he already has...
you want:
$headers = 'From: John Doe <email@address.com>\r\n';
Oh my apologies I didn't read it close enough
Thanks guys -- that works.