hai,
i think there is some problems in your sendmail function. there is another possiblity of sending mail through smtp instead of send mail. the code below will send mail through samtp. from the arguments you can know what are the parameters you has to pass to the function. i think this function will be more helpful to you.
function smtp_mail($from_mail,$to_mail,$from_name,$to_name,$subject,$mailbody)
{
global $mydomain, $addressee;
$smtp = fsockopen("localhost",25);
// if ($smtp == 0) return -1;
// if ($smtp == 0) echo "SMTP call errors: Number $errno and String $errstr<br>";
fputs($smtp,"helo $mydomain\r\n");
$line = fgets($smtp, 1024);
//echo "line helo - $line<br>";
fputs($smtp,"mail from: $from_mail\r\n");
$line = fgets($smtp, 1024);
//echo "line mail from - $line<br>";
fputs($smtp,"rcpt to: $to_mail\r\n");
$line = fgets($smtp, 1024);
//echo "line rcpt to - $line<br>";
fputs($smtp,"data\r\n");
$line = fgets($smtp, 1024);
//echo "line data - $line<br>";
fputs($smtp,"Subject:$subject\r\n");
// fputs($smtp,"From: $from_name\r\n");
fputs($smtp,"From: $from_name <$from_mail>\r\n");
// fputs($smtp,"To: $to_name\r\n");
fputs($smtp,"To: $to_mail\r\n");
fputs($smtp,"Content-Type: text/html\r\n");
fputs($smtp,"\r\n");
//fputs($smtp,"Dear $addressee,\n\n");
fputs($smtp,"$mailbody \r\n");
//echo "BODY is $body<P>";
fputs($smtp,".\r\n");
$line = fgets($smtp, 1024);
//echo "line dot - $line<br>";
fputs($smtp, "QUIT\r\n");
fclose($smtp);
}
regards,
raja singh.
e-healthcarindia.com