I'm using the phpmailer class to send emails. Currently gmail and yahoo do not mark emails as spam, but hotmail always does. How can I prevent this? My code is below.
require_once('../PHPMailer/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "mail.example.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "xxx"; // SMTP username -- CHANGE --
$mail->Password = "xxx"; // SMTP password -- CHANGE --
$mail->Port = "25"; // SMTP Port
$mail->From = "[email protected]"; //From Address -- CHANGE --
$mail->FromName = "xxx"; //From Name -- CHANGE --
$mail->AddAddress($email, $passerusername); //To Address -- CHANGE --
$mail->AddReplyTo("[email protected]", "xxx"); //Reply-To Address -- CHANGE --
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(false); // set email format to HTML
$mail->Subject = "AuthSMTP Test";
$mail->Body = "AuthSMTP Test Message!";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
From
andAddReplyTo
supposed to be different addresses or is that a typo? If you have that in your actual code, it may cause the mail to be filtered as spam. – Tildie