I have a website with a form on it and it just stopped sending the reply’s. I still get the saved copy in my database but I stopped getting the emails. Did something change that my syntax is not correct or did i just do it wrong and get lucky that it ever worked?
[php]<?php
$form = "
are required | |
Full Name: | |
Phone: | |
City: | |
Email: | |
Questions/Comments: | |
";
if ($_POST['submitbtn']){
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$phone = $_POST['phone'];
$city = $_POST['city'];
if ($fullname && $phone && $city && $email && $comment){
if (strstr($email, "@") && strstr($email, ".") && (strlen($email) >= 6)){
mysql_query("INSERT INTO contact VALUES ('', '$fullname', '$phone', '$city', '$email', '$comment', NOW())");
$webmaster = "[email protected]";
$headers = "From: $fullname<$email>";
$subject = "Contact Us Form from $fullname";
$message = "$fullname\r\n$phone\r\n$city\r\n$email\r\n$comment";
mail ($webmaster, $subject, $message, $headers);
echo "Your message has been sent. $form";
}
else
echo "Please enter a valid email address. $form";
}
else
echo "You did not enter all required information. $form";
}
else
echo "$form";
?>[/php]
Server info
PHP Version 5.4.43
Linux Server