Page 1 of 1

Mail error codes from local host

Posted: Tue Oct 15, 2002 6:25 am
by nigel-9SW
I am using a local server to test my web pages, I have an 'mail' instruction in my php code - see sample.

I receive an error message as follows, I am sure it is easy to fix and create an email message that gives the impression that the server has sent the mail. (Apache 2.0.43 Win32)

Warning: Failed to Receive in C:\Web_documents\My Websites\RSGolf\php\handleform.php on line 47

Thx in advance

Code: Select all

<?php 
if ($CallFunction) {
   mail("my.name@mail.com","New Post received",$Body);
   print ("<H3>Thanks for your feedback which now appears in the 
<A HREF="..\html\postroom.php" TARGET="mainbody">postroom</A> </H3>");
} else {
 print ("<H3>Due to a system error your message has not been processed, please try later</H3>");
}

?>

Posted: Tue Oct 15, 2002 6:28 am
by twigletmac
If you just don't want the error to appear during local testing you can suppress it by using '@':

Code: Select all

@mail("my.name@mail.com","New Post received",$Body);
@ will hide any error messages caused by the mail function

Mac

Posted: Tue Oct 15, 2002 6:42 am
by nigel-9SW
:D Good tip thx