Phpmailer not in Hotmail Inbox or Spam?

237 Views Asked by At

So i thought that if you send email to hotmail it would at least arrive in spam but in this case it does not. So have i done something wrong in this code below? I tested the same code with Gmail and it works Perfectly. Sure i think its related to Hotmail Filters.

Things to note, I have setup the email address on my domain and i have an SPF Record setup.

What could be wrong? And how can i check it?

Current PHP:

<?php 

    require 'PHPmailer/PHPMailerAutoload.php';
    $mail = new PHPMailer(true);

try {
    $mail->SMTPDebug = true;
    $mail->SMTPAuth   = true;                  // enable SMTP authentication
    $mail->Host       = "smtpout.secureserver.net"; // sets the SMTP server
    $mail->Port       = 26;                    // set the SMTP port
    $mail->Username   = "username"; // SMTP account username
    $mail->Password   = "password";        // SMTP account password
    $mail->setFrom('email', 'Immortal Insurance');
    $mail->AddAddress('sendtoemail');
    $mail->AddAddress('sendtoemail');
    $mail->Body       = 'This is a test Email';
    $mail->AddAttachment('tosend/policy.pdf');
    $mail->Send();
    echo "Message Sent OK<p></p>\n";
} catch (phpmailerException $e) {
    echo $e->errorMessage();
} catch (Exception $e) {
    echo $e->getMessage();
}


?>
0

There are 0 best solutions below