I posted this question 6 days ago regarding yahoo email issue Email going to SPAM in yahoo and URL not working
Some guys told me there to use SMTP for email sending so that you will receive email in your inbox. I'm using SMTP but still my all emails goes to yahoo spam folder. I dont know what's wrong in my code. Can anyone please help me,
include_once("Mail.php");
$From = "FROM EMAIL";
$To = "TO EMAIL";
$Subject = "Test Email";
$Message = "This is a test email using SMTP";
$Host = "mail.DOMAIN.com";
$Username = "USERNAME";
$Password = "PASSWORD";
$Headers = array("MIME-Version"=> '1.0',
"Content-type" => "text/html; charset=iso-8859-1",
"From" => $From,
"To" => $To,
"Reply-To" => $From,
"Subject" => $Subject);
$SMTP = Mail::factory('smtp', array ('host' => $Host, 'auth' => true, 'username' => $Username, 'password' => $Password));
$mail = $SMTP->send($To, $Headers, $Message);
if (PEAR::isError($mail)){
echo($mail->getMessage());
} else {
echo("Email sent successfully");
}
Note : The issue is only with yahoo, other all emails goes to inbox