I'm new to PHP and HTML working on a website both codes seem to be working. I'm trying to edit an existing contact us form and send the form to a default email but it is getting to the spam folder.
Here is my HTML code part:
<div class="row-fluid">
<div class="span8" id="divMain">
<h1>Contact Us</h1>
<h3 style="color:#;"></h3>
<hr>
<!--Start Contact form -->
<form name="enq" action="contact-form-handler.php" method="POST" onsubmit="return validation();">
<fieldset>
<input type="text" name="name" id="name" value="" class="input-block-level" placeholder="Name" maxlength="80" />
<input type="text" name="email" id="email" value="" class="input-block-level" placeholder="Email" maxlength="80" />
<textarea rows="11" name="message" id="message" class="input-block-level" placeholder="Message" maxlength="1024"></textarea>
<div class="actions">
<input type="submit" value=" Send " name="submit" id="submitButton" class="btn btn-inverse pull-left" title="Click here to submit your message!" />
</div>
</fieldset>
</form>
<!--End Contact form -->
</div>
and here is my PHP code:
<?php
$name=$_POSt['name'];
$vistor_email=$_POST['email'];
$message=$_POST['message'];
$email_from='ex2@gmail.com';
$email_subject="New request to A-Akawi";
//$email_body="User Name:$name.\n"."User Email:$vistor_email.\n"."User message:$message.\n";
$body = <<<EMAIL
You have received a new request from $name with the following email address $vistor_email.
The following request is:
$message.
EMAIL;
$to ='ex1@gmail.com';
$headers .= "From: Johnson Smith <noreply@ksar.com> . \r\n" ;
$headers .='Reply-To: '. $to . "\r\n" ;
$headers .= "Organization: Sender Organization\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
mail($to,$email_subject,$body,$headers);
header("location: contact.html");
?>
I'm getting it to the spam even after adding the headers how to fix it?