I have tried both making and downloaded templets that have a contact form in them and still i can't receive any emails when i test them out i'm on x10's free hosting the form says it sends but when i check for emails there's nothing. I have used both gmail address and at x10's elementfx account and i have still got no where with it. So anyway it is a html5 web site .I am not the best or even claim to know php code but here what i'm using. Can someone please help me.
Here is the html code for emails
<!-- form -->
<h2>Contact Form</h2>
<script type="text/javascript" src="js/form-validation.js"></script>
<form id="contactForm" action="#" method="post">
<fieldset>
<div>
<label>Name</label>
<input name="name" id="name" type="text" class="form-poshytip" title="Enter your full name" />
</div>
<div>
<label>Email</label>
<input name="email" id="email" type="text" class="form-poshytip" title="Enter your email address" />
</div>
<div>
<label>Website</label>
<input name="web" id="web" type="text" class="form-poshytip" title="Enter your website" />
</div>
<div>
<label>Comments</label>
<textarea name="comments" id="comments" rows="5" cols="20" class="form-poshytip" title="Enter your comments"></textarea>
</div>
<!-- send mail configuration -->
<input type="hidden" value="myemail@gmail.com" name="to" id="to" />
<input type="hidden" value="myemail@gmail.com" name="from" id="from" />
<input type="hidden" value="From torn wordpress online" name="subject" id="subject" />
<input type="hidden" value="send-mail.php" name="sendMailUrl" id="sendMailUrl" />
<!-- ENDS send mail configuration -->
<p><input type="button" value="SEND" name="submit" id="submit" /></p>
</fieldset>
<p id="error" class="warning">Message</p>
</form>
<p id="success" class="success">Thanks for your comments.</p>
<!-- ENDS column -->
and here is the send mail php
<?php
/**
*
*
*
*
**/
//vars
$subject = $_POST['subject'];
$to = explode(',', $_POST['to'] );
$from = $_POST['email'];
//data
$msg = "NAME: " .$_POST['name'] ."<br>\n";
$msg .= "EMAIL: " .$_POST['email'] ."<br>\n";
$msg .= "WEBSITE: " .$_POST['web'] ."<br>\n";
$msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n";
//Headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: <".$from. ">" ;
//send for each mail
foreach($to as $mail){
mail($mail, $subject, $msg, $headers);
}
?>
Here is the html code for emails
<!-- form -->
<h2>Contact Form</h2>
<script type="text/javascript" src="js/form-validation.js"></script>
<form id="contactForm" action="#" method="post">
<fieldset>
<div>
<label>Name</label>
<input name="name" id="name" type="text" class="form-poshytip" title="Enter your full name" />
</div>
<div>
<label>Email</label>
<input name="email" id="email" type="text" class="form-poshytip" title="Enter your email address" />
</div>
<div>
<label>Website</label>
<input name="web" id="web" type="text" class="form-poshytip" title="Enter your website" />
</div>
<div>
<label>Comments</label>
<textarea name="comments" id="comments" rows="5" cols="20" class="form-poshytip" title="Enter your comments"></textarea>
</div>
<!-- send mail configuration -->
<input type="hidden" value="myemail@gmail.com" name="to" id="to" />
<input type="hidden" value="myemail@gmail.com" name="from" id="from" />
<input type="hidden" value="From torn wordpress online" name="subject" id="subject" />
<input type="hidden" value="send-mail.php" name="sendMailUrl" id="sendMailUrl" />
<!-- ENDS send mail configuration -->
<p><input type="button" value="SEND" name="submit" id="submit" /></p>
</fieldset>
<p id="error" class="warning">Message</p>
</form>
<p id="success" class="success">Thanks for your comments.</p>
<!-- ENDS column -->
and here is the send mail php
<?php
/**
*
*
*
*
**/
//vars
$subject = $_POST['subject'];
$to = explode(',', $_POST['to'] );
$from = $_POST['email'];
//data
$msg = "NAME: " .$_POST['name'] ."<br>\n";
$msg .= "EMAIL: " .$_POST['email'] ."<br>\n";
$msg .= "WEBSITE: " .$_POST['web'] ."<br>\n";
$msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n";
//Headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8\r\n";
$headers .= "From: <".$from. ">" ;
//send for each mail
foreach($to as $mail){
mail($mail, $subject, $msg, $headers);
}
?>
Last edited: