Page 1 of 1

error in mail() function!

PostPosted: 06. December 2006 16:33
by weblizzer
hello everyone! i already configure my mail server in order to work my mail() function and i use mercury mail instead of sendmail. but i have a problem because my simple code in sending mail on localhost doesn't work! this is my code
---------------------------------------------------------
$to='myname@localhost';
$subject="Viewers Comments and Feedback!";
$header ='postmaster@localhost';
$message= $_POST[message];
mail($to,$subject,$message,$header);
--------------------------------------------------------
and i got an error! here:

mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

--------------------------------------------------------

does anyone know about this? or is there any configuration that i will do! Thanks in Advance
:P

PostPosted: 06. December 2006 16:53
by Wiedmann
Code: Select all
$header ='postmaster@localhost';

mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

IMHO:
Code: Select all
$header = 'From: postmaster@localhost';


BTW:
Code: Select all
$message= $_POST[message];

Should be:
Code: Select all
$message= $_POST['message'];

PostPosted: 06. December 2006 17:09
by weblizzer
Thanks dud! you got it!... :lol: :o :D :) :P :wink: 8)