I have try to send mail using php, but mail goes to spam Below is my code
//send mail
$from = get_option('client_mail');
$to = $_POST['email'];
$subject = get_option('subject_');
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From:".$from."\r\n";
$message1= "<html>
<body>
<table width='100%' border='0'>
<tr>
<td>here is my is mail ending code
</td>
</tr>
</table>
</body>
</html>";
if(mail($to,$subject,$message1,$headers))
{
$yes = 'mail send';
}
else
{
$yes = 'mail not send';
}
After process i got "mail send". And i also try PHPMailerAutoload here is code
if( file_exists("PHPMailer-master/PHPMailerAutoload.php") && is_readable("PHPMailer-master/PHPMailerAutoload.php") && include("PHPMailer-master/PHPMailerAutoload.php")) {
//mail sending
$email = new PHPMailer();
$email->From = 'from_email';
$email->FromName = 'fname';
$email->Subject = 'mail attarchment';
$email->Body = 'after remove atachment';
$email->AddAddress( 'to_email' );
if(!$email->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
}
And here is got after mail process "Message has been sent"