Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP mail problems.Strange.Expert pls help
Old 08-21-2007, 03:05 AM PHP mail problems.Strange.Expert pls help
Junior Talker

Posts: 1
Trades: 0
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

Last edited by henrygao; 08-21-2007 at 03:06 AM..
henrygao is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-21-2007, 10:32 PM Re: PHP mail problems.Strange.Expert pls help
Raulică's Avatar
Ultra Talker

Posts: 253
Location: Constanta,Romania
Trades: 0
You need to edit your php.ini to work with your windows SMTP software.
__________________

Please login or register to view this content. Registration is FREE

Professional hosting for all pockets!

Please login or register to view this content. Registration is FREE
Raulică is offline
Reply With Quote
View Public Profile Visit Raulică's homepage!
 
Reply     « Reply to PHP mail problems.Strange.Expert pls help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10204 seconds with 12 queries