Sending mail php
Posted
by user195257
on Stack Overflow
See other posts from Stack Overflow
or by user195257
Published on 2010-03-13T15:23:44Z
Indexed on
2010/03/13
15:25 UTC
Read the original article
Hit count: 413
Hey, no idea why this sint working, but the message is being sent as "0". I think the e-mail form is what is causing it
<?php
if ($_POST['check'] == 'checked'){
header("location: /nospamplease.html");
exit();
}
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$date = $_POST['date'];
$children = $_POST['children'];
$hot = $_POST['hot'];
$comments = $_POST['comments'];
/*echo $name;
echo $email;
echo $phone;
echo $date;
echo $children;
echo $hot;
echo $comments;*/
if($name == "" || $email == "" || $phone == "" || $date == "" || $children == "" || $hot == "" || $comments == ""){
echo "Please ensure all fields were filled out!";
exit();
}else{
$to = "######";
$subject = "Birthday enquiry";
$message = $message + "Name: "+$name;
$message = $message + "Email: "+$email;
$message = $message + "Phone: "+$phone;
$message = $message + "Date: "+$date;
$message = $message + "Children: "+$children;
$message = $message + "Hot or cold: "+$hot;
$message = $message + "Comments: "+$comments;
//echo $message;
if(mail($to, $subject, $message)){
echo "Thank you for your enquiry, we will contact you within the next 24 hours! <br /> Click <a href='###'> here</a> to go back to the website!";
}else{
echo "There was an error, contact us directly: <a href='mailto:##'>email</a>";
}
}
?>
I echoed out the variables, they all are getting posted fine
Thanks guys
© Stack Overflow or respective owner