I'm having a classic PHP form submission error. I tested the code earlier and it seemed to be working now when testing it again, the email never arrives.
This is the HTML (I changed the site/email address for security reasons of course)
<!-- Contact Form -->
<form method="post" action="http://example.net/assets/mail/mail.php">
<div class="row 50%">
<div class="6u 12u(mobile)"><input type="text" name="name" placeholder="Name" />
</div>
<div class="6u 12u(mobile)"><input type="email" name="email" placeholder="Email" />
</div>
</div>
<div class="row 50%">
<div class="12u"><textarea name="message" placeholder="Message" rows="6"></textarea>
</div>
</div>
<div class="row">
<div class="12u">
<ul class="actions">
<li>
<input type="submit" value="Send Message" />
</li>
</ul>
</div>
</div>
</form>
This is the PHP file:
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "es@example.net";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
The PHP file is located at the same place the HTML links to: http://example.net/assets/mail/mail.php and the email itself is working fine (use it daily). When I test the form out I get the echo/message saying thank you so is definitely finding the PHP file however, I simply don't get anything on my inbox.
Is such a simple code yet I'm really confused and unsure what is going on.
Any help is truly appreciate it.