Hi there
My Contact Form submits everything and tells me that it has been submitted but if i go to my mail box i do not receive any email from my contact form please can someone just help me I cant seem to get the problem .
Here is my Bootstrap form code:
<form class="form-horizontal" role="form" method="post" action="send_form_email.php">
<div class="form-group">
<label class="control-label col-md-2" for="full_name">Your Full Name:</label>
<div class="col-md-10">
<input required="required" type="text" class="form-control" id="full_name" name="full_name" placeholder="Full Name" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2" for="telephone" >Your Telephone</label>
<div class="col-md-10">
<input required="required" type="text" class="form-control" id="telephone" name="telephone" placeholder="Your Telephone" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2" for="email">Your Email:</label>
<div class="col-md-10">
<input required="required" type="email" class="form-control" id="email" name="email" placeholder="Your Email" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2" for="message">Your Message:</label>
<div class="col-md-10">
<textarea required="required" rows="6" class="form-control" id="message" name="message" placeholder="Your Message"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit">Send</button>
</div>
</form>
and Here is my PHP Script:
i tried changing this if(isset($_POST[‘email’])) to if(isset($_POST[‘submit’])) but no success
<?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@momentdesigns.co.za"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below."; echo $error."
"; echo "Please go back and fix these errors.
"; die(); } // validation expected data exists if(!isset($_POST['full_name']) || !isset($_POST['telephone']) || !isset($_POST['email']) || !isset($_POST['message'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $full_name = $_POST['full_name']; // required $telephone = $_POST['telephone']; // required $email_from = $_POST['email']; // required $message = $_POST['message']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.
'; } $telephone_exp = '/^[0-9]*$/'; if(!preg_match($telephone_exp,$telephone_from)) { $error_message .= 'The Telephone number you entered does not appear to be valid.
'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$full_name)) { $error_message .= 'The Full Name you entered does not appear to be valid.
'; } if(strlen($message) < 2) { $error_message .= 'The Message you entered do not appear to be valid.
'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Full Name: ".clean_string($full_name)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Message: ".clean_string($message)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); sleep(2); echo ''; echo ""; ?>
<?php
}
?>