Page 1 of 1

Error in sending a email..

Posted: Wed Aug 19, 2009 1:01 am
by varma457
Hi,

I have problem with sending EMAIL..

I am simple script to send a email..


$to = "abc@yahoo.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

But it is showing the error..
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\chitti1\xampp\htdocs\Test\mail.php on line 9

Re: Error in sending a email..

Posted: Wed Aug 19, 2009 2:53 am
by Christopher
The error message says 'custom "From:" header missing'. Check the manual for the mail() function. It has an example of how to set the From: header.