My code:
<?php
$mymessage = "";
$mymessage .= $HTTP_POST_VARS["firstname"] . " " . $HTTP_POST_VARS["lastname"] . " requested a QuickQuote.\r\n";
$mymessage .= "Email: " . $HTTP_POST_VARS["email1"] . "\r\n";
$mymessage .= "Phone: " . $HTTP_POST_VARS["phone"] . "\r\n";
$mymessage .= "The visitor would like to move thier piano on " . $HTTP_POST_VARS["monthmove"] . " " . $HTTP_POST_VARS["daymove"] . ", " . $HTTP_POST_VARS["yearmove"] . "\r\n";
if ($HTTP_POST_VARS["move"] != "")
{
$mymessage.= "A move has been requested.\r\n";
}
if ($HTTP_POST_VARS["tune"] != "")
{
$mymessage.= "A tunning has been requested.\r\n";
}
if ($HTTP_POST_VARS["repair"] != "")
{
$mymessage.= "A repair has been requested.\r\n";
}
$mymessage .= "The piano is a " . $HTTP_POST_VARS["pianotype"] . " that is " . $HTTP_POST_VARS["ageofpiano"] . " years old.\r\n";
$mymessage .= "It was last tuned in " . $HTTP_POST_VARS["monthtune"] . " of " . $HTTP_POST_VARS["yeartune"] . ".\r\n";
$mymessage .= "The piano is currently at " . $HTTP_POST_VARS["fromcity"] . ", " . $HTTP_POST_VARS["fromstate"] . " (" . $HTTP_POST_VARS["fromzip"] . ").\r\n";
$mymessage .= "There are " . $HTTP_POST_VARS["fromstairs"] . " fleights of stairs.\r\n";
$mymessage .= "The piano needs to be moved to " . $HTTP_POST_VARS["tocity"] . ", " . $HTTP_POST_VARS["tostate"] . " (" . $HTTP_POST_VARS["tozip"] . ").\r\n";
$mymessage .= "There are " . $HTTP_POST_VARS["tostairs"] . " fleights of stairs.\r\n";
$mymessage .= "\r\nHere are any notes (optional):\r\n";
$mymessage .= $HTTP_POST_VARS["repairs"] . "\r\n\r\n";
$mymessage .= "You man contact the visitor via " . $HTTP_POST_VARS["contact"] . "\r\n";
$myname = "Move N Tune Website";
$myemail = "admin@foobaret.com";
$contactname = "Conrad Smith";
$contactemail = "conrad@foobar.com";
$subject = "Piano QuickQuote Request";
$headers = "";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Just My Server";
mail("conrad@foobar.com", "Piano QuickQuote Request", $mymessage, $headers)
?>
<HTML>
<HEAD>
<TITLE>Send Quote</TITLE>
</HEAD>
<BODY>
<br>
<?php print preg_replace("/\r\n|\n\r|\n|\r/", "<br>", $mymessage); ?>
</BODY>
</HTML>
The Error:
Warning: Server Error in c:\inetpub\wwwroot\shad\movepiano\quickquotesend.php on line 52
Yeah I know, it's not much to go on.
I am using PHP on an IIS 5 (Widows 2000) server (also running .NET).
I do have the newest PHP engine that is made to run on .NET servers. I am running PHP in ISAPI, not CGI, mode.
I do have the SMTP service installed and running. I have changed the SMTP server in the PHP.INI from localhost to an exterrnal (my ISP's) SMTP server to no effect.
I have also tried the following code:
mail("conradfsmith3@yahoo.com", "Piano QuickQuote Request", "Test");
Also to no positive effect.
Any help would be most appreciated.
Conrad