a thank you email sent to them once they have filled my form
Posted: Fri Sep 16, 2005 6:11 am
Hi peolpe, i have a form for users to fill in and once it has been submitted to me., the user will automaticly be sent an e-mail to them from me telling them thanks.
is this possible?
here is my code if it helps
is this possible?
here is my code if it helps
Code: Select all
<?php
if(isset($_POST['submit'])) {
$to = "myemail@me.co.uk";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$menu = $_POST['select'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}
"<select name=\"select\">";
"<option value=\"prod 1\">prod 1</option>";
"<option value=\"prod 2\">prod 2</option>";
"<option value=\"Alt 3\">Alternative 3</option>";
"<option value=\"Alt 4\">Alternative 4</option>";
"<option value=\"Alt 5\">Alternative 5</option>";
"</select>";
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message $check_msg $menu";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>