Forum Moderators: coopster
<form action="mail.php" method="post">
Your Name: <input type="text" name="name"><br>
E-mail: <input type="text" name = "email"><br><br>
<input type="submit" value="Submit">
</form>
<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$to="support@example.com";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
[edited by: jatar_k at 4:30 pm (utc) on July 6, 2005]
[edit reason] generalized email [/edit]