Ok so i've got this form on my index.html page:
<form method="post" action="contact.php">
<div class="row uniform 50%">
<div class="6u 12u$(xsmall)">
<input type="text" name="name" id="name"
value="" placeholder="Name / Company Name" required />
</div>
<div class="6u$ 12u$(xsmall)">
<input type="email" name="email" id="email" value="" placeholder="Email" required />
</div>
</div>
<br>
<div class="12u$">
<textarea name="message" id="message" placeholder="Enter your message" rows="6" required></textarea>
</div>
<br>
<div class="12u$">
<ul class="actions">
<li>
<input type="submit" value="Send Message" class="special" /></li>
<li>
<input type="reset" value="Reset" /></li>
</ul>
</div>
</form>
And this contact.php page which is supposed to send the email with the data from the HTML form to my email:
<?php
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
$mail_to='my@email.com'; -> hid it for privacy
$mail_subject='New submission from the Contact Form';
$mail_body="From: $email\n Name: $name\n Message:\n $message";
$header = "Content-type: text/html\n";
mail($mail_to, $mail_subject, $mail_body, $header);
}
header('Location: thankyou.html');
exit;
?>
For some reason the php script is not sending any email to the targeted email address. The server is configured fine, i ran a testmail.php script that succesfully sent the mail to the target. Any help would be appreciated.