Hotmail block email from php

January 12, 2015 1.1k views

Hi, i'm on ubuntu 14.04 and I try to send an email using php mail function :

        $headers = 'From: contact <>'."\r\n";
        $headers .= 'Bcc: Me <>; Him <>'."\r\n";
        $headers .= "\r\n";
         if(mail(", "subject", 'From:', $headers) &&
            mail("", "subject", 'From:', $headers)
echo "good";}else{echo "bad";} ?>

Gmail always receive the message, but hotmail don't... Can anyone help me?
I just want to mention that it use to work with my /etc/hosts file set as : localhost.localdomain localhost yourhostname

  • Have you set up SPF records for your domain and does your droplet have a fully qualified domain or subdomain as it's name?

  • Yes a have one : a TXT with v=spf1 mx ip4:XXX.XXX.XX.X -all

  • And how do you check if you have a fully qualified domain?

  • I am having the same problem. I also signed up for a Microsoft SNDS account, but that doesn't seem to help.

    I have the SPF record working (as verified by google) and setup DKIM (again, verified by google). I don't seem to have problems sending to either Yahoo or Gmail, but messages are dropped for and

Be the first one to answer this question.