I am trying to power my contact form with the following HTML and PHP, and when I enter information and press enter, I always get an Error!
HTML
<form action="contact.php" method="POST">
<input type="text" placeholder="your name" name="name">
<input type="email" placeholder="Your Email" name="email">
<textarea placeholder="Your Message" name="message"></textarea>
<button type="submit">submit</button>
</form>
PHP
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent=" From: $name
Email: $email
Message: $message";
$recipient = "jainkenul@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email
";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
I have uploaded these files on my server, you can check it here
I don't see any error in your code. Probably, your host may have disabled the mail() function