Hi,
I’m needing a little help with this bit of PHP code. I’m new to this and this is my first attempt. When I submit the form on the website it gives me the successful message (form data etc successfully sent to myemail@somehost etc), but the information/email never, ever arrives. I’m sending it to my own email address, which is not Hotmail, Yahoo etc. Can someone take a knowing look at it and possibly tell me where I’m going wrong? ? Its only a basic form consisting of four data fields…?
Below is my PHP script I have placed on the server. Please help!
[code=php]
<?php
// setup php basic configuration
$email_to = ‘[email protected]’;
$subject = ‘website enquiry’;
//receive variables from contact mail_form
$Contact_Name = $_POST[‘Contact_Name’];
$Contact_Number = $_POST[‘Contact_Number’];
if ($Contact_Number == NULL){
$dont_send = true;
} else {
$dont_send = false;
}
$Contact_email = $_POST[‘Contact_email’];
$customer_enquiry = $_POST[‘customer_enquiry’];
$messafe = “Name: ” . $Contact_Name . “n”;
$messafe .= “Number: ” . $Contact_Number . “nn”;
$messafe .= “Email: ” . $Contact_email . “nn”;
$messafe .= “Enquiry: ” . $customer_enquiry . “nn”;
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<?php echo $Contact_Name.”,br/>”.$Contact_Number.”,br/>”.$Contact_email.”,br/>”.$customer_enquiry.”,br/>” ;
?>
<?php
if ($dont_send == false){
if ( mail($email_to , $subject , $message ) ) {
echo “Email successfully sent to ” . $email_to ;
} else {
echo “Email failed to send”;
}
} else {
echo “Please Fill in your Contact Number” ;
}
?>
</body
></body>
</html>