I have set up a contact form which is to send email to anyone from WordPress page. It's sending email but all are going to SPAM folder. How to prevent it to go to Spam folder but go to Inbox?
however, I gave it try from another wordpress site, all emails going to inbox perfectly, and I've found a difference that is all email going to inbox has one extra line in details that is-
mailed-by: p6plcpnl0235.prod.phx3.secureserver.net
But the emails going to the SPAM folder doesn't have this above line, Is it can be a cause? If so how to enable this secureserver.net
Can anyone please help me?
Here is what I am using in page-
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$admin_email = "admin@mail.com";
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$comment = $_REQUEST['comment'];
//send email
mail($email, $subject, $comment, "From:" .$admin_email);
//Email response
header('Location: /email-sent');
}
//if "email" variable is not filled out, display the form
else {
?>
<div class="container send-email-form-wrapper">
<div class="row">
<div class="send-email-form">
<form method="post">
<li> Email: <input name="email" type="text" /> </li>
<li> Subject: <input name="subject" type="text" /></li>
<li> Message: <textarea name="comment" rows="5"></textarea></li>
<li><input type="submit" value="Submit" /></li>
</form>
</div>
</div>
</div>
<?php
}
?>