I mail using php mail function to send e-mail. In my dev server its working fine but in live server e-mail goes to spam folder.
<?php
$to = "example@gmail.com";
$subject = "Registration";
$from = "example1@gmail.com";
$content = "Test";
$headers = "From: Test <" . strip_tags($from) . ">\r\n";
$headers .= "MIME-Version:1.0" ."\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
$res = mail($to,$subject,$content,$headers);
$headers = "From: Test <" . strip_tags($to) . ">\r\n";
$headers .= "MIME-Version:1.0" ."\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
$res2 = mail($from,$subject,$content,$headers);