0

I've been googling and trying different solutions for hours. It works fine with GMail and Yahoo, but with Hotmail, it goes to the junk folder.

This is my code:

 $sender = "xxx";
$sendername = "xxx";
$recipient = "xxx";
$recipientname = "xxx;
$pm->SetFrom($sender, $sendername);
$pm->AddReplyTo($sender, $sendername);
$pm->Sender = "xxx";
$pm->AddAddress($recipient, $recipientname);
$pm->IsSMTP();
$pm->SMTPAuth = true;
$pm->SMTPDebug = 2;

$pm->Host = "mail.xxx.com";
$pm->Port = 587;
$pm->Username = "xxx";
$pm->Password = "xxx";


$pm->Subject = "xxx news";
$pm->AddEmbeddedImage('forumLogo.png', 'logo');
$pm->Body = 'Here is my HTML content, not spammy.
    </body>
</html>';


$pm->isHTML(true);
var_dump($pm->ErrorInfo);
if(!$pm->Send()) {
    echo "Couldn't send: " . $pm->ErrorInfo;
}
else {
    echo "Sent";
}
  • This might be a duplicate of [this other question/answer](http://stackoverflow.com/questions/9899768/phpmailer-sending-mail-to-spam-in-hotmail-how-to-fix)... – summea May 11 '13 at 02:44
  • I've tried the header solution there, but it didn't help. – user2311073 May 11 '13 at 02:46
  • Hmm; in my limited experience, if the headers approach doesn't work... sometimes the only way to avoid having the mail sent to the junk folder is to have the email recipient actually tell their Hotmail (or whatever email client/host) account that this email should be received normally by marking this type of message as "not spam" or "not junk". It's annoying, though; – summea May 11 '13 at 02:55

0 Answers0