zushiba Posted December 5, 2007 Share Posted December 5, 2007 I work at a school and while they use MS for everything including running ASP on their main sites I managed to convince them to set up a box running Apache & PHP, I didn't want to push my luck so it's running in windows with mssql. For a project we're working on I need to set up a forum for the various instructors to be a kind of virtual meeting ground so we don't have to meet in real life. Here's the problem, somehow the mail settings are incorrect, while not having access to php.ini I need to figure out whats wrong and how to fix it. To do this I've set up a very basic form to send some test data to a given email address, the form itself works wonderfully so I won't bother pasting that here. Here's the code <?php include("global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','email_addy'); pt_register('POST','name'); pt_register('POST','pass'); pt_register('POST','testbox'); //echo $email_addy; if($errors==1) echo $error; else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="name: ".$name." pass: ".$pass." testbox: ".$testbox." "; $message = stripslashes($message); mail($email_addy,"Form Submitted at your website",$message,"From: The Mail Test"); ?> <h2>Thank you!</h2> <table width=50%> <tr><td>name: </td><td> <?php echo $name; ?> </td></tr> <tr><td>pass: </td><td> <?php echo $pass; ?> </td></tr> <tr><td>testbox: </td><td> <?php echo $testbox; ?> </td></tr> </table> I have this exact script set up and working absolutely perfectly on my own server, so the code cannot be the problem. On my box it sends mail perfectly however on the windows box at work I get the following Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in D:\web sites\IR Website\mailTest\process.php on line 18 I'm unsure what the problem could be, since I have the same code running on my apache/linux server and it's functioning properly. Here are the mail settings in the php.ini [mail function] ; For Win32 only. SMTP = 192.168.254.206 ; for Win32 only smtp_port = 25 sendmail_from= "mail operator" ; for Win32 only ; For Win32 only. ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = I am unsure how to tell what the problem is and so fixing it is kind of tough Quote Link to comment 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.