0

my contact form is not working when I try to send a message. I'm not a backend developer that's why am not able to figure out the issue. my files are in my hosting server. so can anybody please tell what wrong am I doing.

HTML

<form action="contact-form.php" method="post" name="contact-form" autocomplete="off">
    <input type="text" placeholder="Your Name" name="name">
    <input type="text" placeholder="Your Email" name="email">
    <input type="Message" placeholder="Message" name="message">
    <input type="submit" value="Send" name="submit">
</form>

PHP

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "salmanbinhilabi@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
Kinan Alamdar
  • 437
  • 1
  • 6
  • 22
  • What is the result of your code? Are you getting any errors, or are the emails just not being received? – Ryan Jan 02 '19 at 18:09
  • Ryan, it just sends me to a new page with text Error! where I have written above if in case the mail die. – Kinan Alamdar Jan 02 '19 at 18:11

0 Answers0