View Full Version : about mail() function

06-07-2005, 06:02 AM
i used following codes


but the problem is when i send to yahoo mail. the from colunm display "nobody", how to show the sender's name on it.

SeeIT Solutions
06-07-2005, 07:24 AM
try using this

$headers = 'From: Someone <someone@somewhere.com>'."\r\n"; //from
$headers .= 'Content-Type: text/html; charset="ISO-8859-1"'."\r\n"; //if you want content to be html

06-07-2005, 11:41 AM
You also have to send a mime header.

mail('recipient@some.net', 'Subject',
'<html><body><p>Your <i>message</i> here.</p></body></html>',
"To: The Receiver <recipient@some.net>\n" .
"From: The Sender <sender@some.net>\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");

If you want more information there's a good tutorial/article on sitepoint. (http://www.sitepoint.com/article/advanced-email-php)