dear friends:
Recently i moved my application from linux enviroment to windows2003 enviroment. everything is ok but mail function.
after i setup mail server in windows, i tested it by sending a email to
support@mydomain.com and i can receive it. and I also login to my domain email and send email via
support@mydomain.com also ok.
--------------
but the problems: all the system email related function not working (which they works in linux enviroment).
the code for tell frined function like below:
-----------------------
$headers .= "From: {$in['YouEmail']}\r\n";
$headers .= "To: {$in['Email']}\r\n";
$title .= "Your friend {$in['UserName']} sent your this link";
if(@mail($in['Email'], $title , $tmp . $in['Content'], $headers))
{
$Info = new Info('Email was sent successfully! Your friend will receive your email soon!.',
_PHP_SELF . '?act=login', $tpl);
$tpl->set_currentfile('main');
$tpl->set_var('DATA', $Info->Show());
}
else
{
new Error('Fail to send email, please contact admin to check email server configration.',
'', _CurrentURL, $tpl);
}
----------------------
after execution of the code, it gives error "fail to send email...".
however, only one function works which is feedback function, the code as below:
$tpl->set_var('Title', $in['Title']);
$tpl->set_var('Sender', $in['Sender']);
$tpl->set_var('Email', $in['Email']);
$tpl->set_var('Content', $in['Content']);
$tpl->set_var('SenderIP', ip2long($in['REMOTE_ADDR']));
$str = $tpl->parse('mail');
$headers .= "From: domain.com <support@domain.com>\r\n";
$headers .= "To: domain.com <support@domain.com>\r\n";
@mail("
support@domain.com", SYS_NAME . $title, $str, $headers);
}
-----
It really makes me confused how it happens? Is there any expert can advise some suggestion? Pls help... thank you