henrygao Posted August 21, 2007 Share Posted August 21, 2007 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 fnction not (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 Quote Link to comment https://forums.phpfreaks.com/topic/65931-php-mail-problem-expert-please-helpplease/ Share on other sites More sharing options...
vijayfreaks Posted August 21, 2007 Share Posted August 21, 2007 Hi.. try to run mail function without "@" (error control operator) and check what it says... from this you may have more idea about it.. Quote Link to comment https://forums.phpfreaks.com/topic/65931-php-mail-problem-expert-please-helpplease/#findComment-329604 Share on other sites More sharing options...
vijayfreaks Posted August 21, 2007 Share Posted August 21, 2007 Hi.. try to run page without error control operator "@".. and see what error say.. from this you have more idea about it, fore more:"http://www.drquincy.com/resources/tutorials/webserverside/sendemailattachmentphp" Regards, Vijay Quote Link to comment https://forums.phpfreaks.com/topic/65931-php-mail-problem-expert-please-helpplease/#findComment-329606 Share on other sites More sharing options...
henrygao Posted August 22, 2007 Author Share Posted August 22, 2007 Hi.. try to run page without error control operator "@".. and see what error say.. from this you have more idea about it, fore more:"http://www.drquincy.com/resources/tutorials/webserverside/sendemailattachmentphp" Regards, Vijay hi vijar: I just tried as your said. but it seems no change from the output. pls advise futher. thank you very much Quote Link to comment https://forums.phpfreaks.com/topic/65931-php-mail-problem-expert-please-helpplease/#findComment-330657 Share on other sites More sharing options...
vijayfreaks Posted August 22, 2007 Share Posted August 22, 2007 Hi.. So may I know what error r u getting? -Vijay Quote Link to comment https://forums.phpfreaks.com/topic/65931-php-mail-problem-expert-please-helpplease/#findComment-330661 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.