I've got a simple mailer up and everything seems to be working, it validates the fields and gives the thank you message, but no email ever gets sent.
mail.html
ajaxSubmit.php
any ideas?
mail.html
Code:
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<link href=' [URL unfurl="true"]http://fonts.googleaplis.com/css?family=Permanent+Marker'[/URL] rel='stylesheet'>
<link rel="stylesheet" href="CSS/form.css" type="text/css" media="all">
<link rel="stylesheet" href="CSS/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="CSS/template.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="[URL unfurl="true"]http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"[/URL] type="text/javascript"></script>
<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
$("#form1").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "ajaxSubmit.php",
ajaxSubmitMessage: "Thank you, We will contact you soon !",
success : false,
failure : function() {}
})
});
</script>
</head>
<body>
...some html here...
<div id="wrapper">
<h1>Contact Us:</h1>
<div id="form-div">
<form class="form" id="form1" method="post" action="ajaxSubmit.php">
<p class="name">
<input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input" id="name">
<label for="name">Name</label>
</p>
<p class="email">
<input name="email" type="text" class="validate[required,custom[email]] text-input" id="email">
<label for="email">E-mail</label>
</p>
<p class="text">
<textarea name="text" class="validate[required,length[6,300]] text-input" id="comment"></textarea>
</p>
<p class="submit">
<input type="submit" value="Send">
</p>
</form>
</div><!-- end form -->
</div><!--end wrapper-->
</body>
</html>
ajaxSubmit.php
Code:
<?php
$name = $_POST['name']; // contain name of sender
$email = $_POST['email']; // Email address of sender
$body = $_POST['text']; // Your message
$receiver = "me@myEmail.com" ; // The email address that all our feedbacks will be sent to
if (!empty($name) & !empty($email) && !empty($body)) {
$body = "Name:{$name}\n\nComments:{$body}";
$send = mail($receiver, 'Contact Form Submission', $body, "From: {$email}");
if ($send) {
echo 'true'; //if everything is ok,always return true , else ajax submission won't work
}
}
?>
any ideas?