hey all, i have a script that worked, now I am getting an error that I can't figure out. Funny thing is the error is being displayed to the screen,you have to view the source from the browser to see it in the html it reads "<b>Warning</b>: Server Error in <b>d:\home\hnt3c223\mail.php</b> on line <b>41</b>" now obviously I know where it says the error is, but that is my mail(....); Here is my mail.php page

<?php
$MailToAddress = "survey@germiphene.com";
$MailSubject = "customer survey";
if (!$MailFromAddress) {
$MailFromAddress = "reply@survey.mail";
}
$Header = "";
$Footer = "";
?>
<html>
<body bgcolor="#EEEAD7" text="#EEEAD7">
<div align="center"><b><font color="666633">Your information has been delivered:</font>
</b>
<p>
<b><font color="666633">Thank You!</font></b>
<p>
<form>
<div align="center">
<input type=button name="quit" value="Close this window" onClick="self.close();">
</div>
</form>
<?php
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
echo "<b>$key</b> = $val<br>";
$Message .= "$key = $val\n";
}

if ($Header) {
$Message = $Header."\n\n".$Message;
}

if ($Footer) {
$Message .= "\n\n".$Footer;
}
//error line below
mail( "$MailToAddress", "$MailSubject", "$Message", "From: $MailFromAddress");
?>
<br>
<br>

<!--<br><br>
<a href="<? echo "$HTTP_REFERER"; ?>">Return To The Mail Form</a><br><br>-->
</div>

</body>
</html>

all that I have on my form page is the post method and an action pointing to mail.php, and I have tried saving that file as both an .html and .php?????

Any help please

    Likely is a mail server problem, like the message says, not a web server/PHP one. Do you run the mail server?? If not, talk to the admin who does...something's up with your server's "mailability", heh....

      true true...I'll see what they say, cause I don't run the mail server

      thanks

        true true...I'll see what they say, cause I don't run the mail server

        thanks

          dalecosp....

          not sure if you are still around, but I contacted the mail server and they can't figure out what is up, they even gave me a sample mail script that worked, unfortunately I need the part of my code that wraps all the variables from the form into one to make the message body, and their code doesn't utilize anything like that. if you can think of anything else that may help, please let me know or anyone else that reads this...thanks

            Hmmm,

            usually I see the mail() done thusly:

            mail($to, $subject, $message, $headers);

            Your code is adding the headers before the message...as part of it, indeed. Wonder if that'd make any difference?

            Only thing I can think of. I do type well, but I'm not really that smart. I will be keeping an eye on the thread however. Good luck!!

              tried something else, but no matter what I can't get the $message to send, it has to do with globals, cause I can send anything else BUT that variable. I took out the headers. I know that the below might look poor, but trust me I thought I had something nice b4 and I have worked backwards just for the sake of attempting not to kill myself..."so it has to do with the way that $message is being passed around"

              <html>
              <body bgcolor="#EEEAD7" text="#EEEAD7">
              <?php

              $message=""; //tried assigned this to the function below and then returning it, but that didn't work either:(
              DisplayArray( $HTTP_POST_VARS );
              
              function DisplayArray ( $aArray )
              {	
              $to = "survey@germiphene.com";
              $subject = "customer survey";
              if (!$from) { $from = "sean@germiphene.com"; }
              global $message;
              
              foreach( $aArray as $key => $val )
              {
               $val=stripslashes($val);
              	 echo  "<b>$key</b> = $val<br>";
              	 $message .= "$key = $val\n";
              }
              echo "hello all<br>"; //just for spacing, debug tool
              }
              
              echo "$message";
              mail($to, $subject, $message);

              ?>

              <div align="center"><b><font color="666633">Your information has been delivered:</font></b>
              <p>
              <b><font color="666633">Thank You!</font></b>
              <p>
              <form>
              <div align="center">
              <input type=button name="quit" value="Close this window" onClick="self.close();">
              </div>
              </form>

              <!--<br><br><a href="<? echo "$HTTP_REFERER"; ?>">Return To The Mail Form</a><br><br>-->
              </div>

              </body>
              </html>

                Write a Reply...