laughton
01-25-2010, 02:30 AM
Hi guys,
I'm a real beginner here and I could really do with some advice!
I've created a (very simple) PHP form for my client and have tested it but entering my hotmail e-mail address to send the form to. This seems to work fine. When I enter my client's e-mail address however, the form seems to send, (and re-directs you to the 'thankyou' page) but my client is not recieving any emails?! (not even in their junk mail folder)
I have posted my code below if it helps. I'm a bit lost here and my client's e-mail provider are not too helpful.
Thanks in advance guys.
<?php
if(isset($_POST['submit'])) {
$to = "CLIENT_EMAIL_HERE";
$subject = "Contact / Booking Form from booking Website";
$name = $_REQUEST['name'];
$email_field = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$headers = "From: $name via booking website";
$body = "From: $name \n\n E-Mail: $email_field\n\n Phone Number: $phone\n\n Message:\n $comments\n";
header( "Location: thankyou_contact.html" );
mail($to, $subject, $body, $headers);
} else {
echo "Unexpected error. Please contact your website host";
}
?>
I'm a real beginner here and I could really do with some advice!
I've created a (very simple) PHP form for my client and have tested it but entering my hotmail e-mail address to send the form to. This seems to work fine. When I enter my client's e-mail address however, the form seems to send, (and re-directs you to the 'thankyou' page) but my client is not recieving any emails?! (not even in their junk mail folder)
I have posted my code below if it helps. I'm a bit lost here and my client's e-mail provider are not too helpful.
Thanks in advance guys.
<?php
if(isset($_POST['submit'])) {
$to = "CLIENT_EMAIL_HERE";
$subject = "Contact / Booking Form from booking Website";
$name = $_REQUEST['name'];
$email_field = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$headers = "From: $name via booking website";
$body = "From: $name \n\n E-Mail: $email_field\n\n Phone Number: $phone\n\n Message:\n $comments\n";
header( "Location: thankyou_contact.html" );
mail($to, $subject, $body, $headers);
} else {
echo "Unexpected error. Please contact your website host";
}
?>