<?
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Class Name: $classname\n";
$msg .= "Teachers Name: $teachersname\n";
//$msg .= "Message: $message\n\n";
if($field1 != "") {
$msg .= "$field1 $name1\n";
}
if($field2 !="") {
$msg .= "$field2 $name2\n";
}
if($field3 !="") {
$msg .= "$field3 $name3\n";
}
if($field4 !="") {
$msg .= "$field4 $name4\n";
}
if($field5 !="") {
$msg .= "$field5 $name5\n";
}
if($field6 !="") {
$msg .= "$field6 $name6\n";
}
if($field7 !="") {
$msg .= "$field7 $name7\n";
}
if($field8 !="") {
$msg .= "$field8 $name4\n";
}
if($field9 !="") {
$msg .= "$field9 $name5\n";
}
if($field10 !="") {
$msg .= "$field10 $name6\n";
}
if($field11 !="") {
$msg .= "$field11 $name7\n";
}
$to = "tharris@spylan.com";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: \n\n";
mail($to, $subject, $msg, $mailheaders) or die(error);
?>
<HEAD>
<TITLE>Simple Feedback Form Sent</TITLE>
</HEAD>
<BODY>
<H1>The following e-mail has been sent:</H1>
<? echo '<p><strong>To:</strong>'; ?>
<? echo $to; echo '</p>'; ?>
<? echo '<P><strong>Classname: </strong><br>'; ?>
<? echo $classname; echo '</p>'; ?>
<? echo '<P><strong>Teacher Name </strong><br>'; ?>
<? echo $teachername; echo '</p>'; ?>
<? echo '<P><strong>Teachers e-mail </strong><br>'; ?>
<? echo $teachercontact; echo '</p>'; ?>
<? if($field1 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field1; echo ': </strong><br>';
echo $name1; echo '</p>' ; } ?>
<? if($field2 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field2; echo ': </strong><br>';
echo $name2; echo '</p>' ; } ?>
<? if($field3 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field3; echo ': </strong><br>';
echo $name3; echo '</p>' ; } ?>
<? if($field4 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field4; echo ': </strong><br>';
echo $name4; echo '</p>' ; } ?>
<? if($field5 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field5; echo ': </strong><br>';
echo $name5; echo '</p>' ; } ?>
<? if($field6 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field6; echo ': </strong><br>';
echo $name6; echo '</p>' ; } ?>
<? if($field7 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field7; echo ': </strong><br>';
echo $name7; echo '</p>' ; } ?>
<? if($field8 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field8; echo ': </strong><br>';
echo $name8; echo '</p>' ; } ?>
<? if($field9 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field9; echo ': </strong><br>';
echo $name9; echo '</p>' ; } ?>
<? if($field10 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field10; echo ': </strong><br>';
echo $name10; echo '</p>' ; } ?>
<? if($field11 =="") {
echo "";
} else {
echo '<p><strong>'; echo $field11; echo ': </strong><br>';
echo $name11; echo '</p>' ; } ?>
</BODY>
This is what it looks like. I have even gone as far as adding the full path to sendmail in the php3.ini (/usr/bin/sendmail -t). This server is handling mail for clients just fine, I really don't understand what the problem is.
ps. PHP4 was supposed to be set up on this server, but judging from the fact that the file is php3.ini instead of php.ini leads me to believe it is PHP3. This, however should affect the script.
moonie 😉