Jump to content

PHP mail problem! Expert, please help...please


henrygao

Recommended Posts

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.