MY PHPMailer email goes to Spam for YahooMail and Hotmail, but not for Gmail. After running Port25's authentication verifier test to make sure my email settings were good these were the summary of the results:
Summary of Authentication Verifier - SPF check: pass - DomainKeys check:neutral - DKIM check:neutral - SpamAssassin check: ham (Message me if you want the full details)
WHAT I'VE TRIED:
- SMTPAUTH = TRUE
- DOMAIN NOT BLACKLISTED: voozlr.com
- Authentication Verifier Test Passed
- REMOVED ALL IMAGES
- REMOVED ALL CONTENT EXCEPT FOR BODY: TEST
I'm hosting my site and email server on Interserver.net, and they made sure everything is working from their end, but I still go to SPAM.
So what are the best practices for my PHP code to avoid the spam folder? Someone please give me an example code or better yet edit my code to show me what SPAM free PHPMAILER code looks like.
PHP CODE:
$mail2 = new PHPMailer();
$mail2->IsMail();
$mail2->Host = "mail.mydomain.com";
$mail2->CharSet = "UTF-8";
$mail2->SMTPAuth = true;
$mail2->Username = "name@mydomain.com";
$mail2->Password = "password1234";
$mail2->SMTPSecure = 'TLS';
$mail2->Port = 25;
$mail2->setFrom('support@mydomain.com', 'Support');
$mail2->AddAddress("$email");
$mail2->AddReplyTo('support@mydomain.com');
$mail2->WordWrap = 50;
mail($to, $subject, $message, $headers);
$mail2->Subject = "Testing";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers = "From: " . strip_tags($_POST['admin@mydomain.com']) . "\r\n";
"Reply-To: support@mydomain" . "\r\n";
$message .= 'test';
$mail2->Body = $message;
$mail2->AltBody = $message;
if(!$mail2->Send())
{
echo "Message could not be sent. Please reload the page and try again. <p>";
echo "Mailer Error: " . $mail2->ErrorInfo;
exit;
}