roud
By:
roud

Hotmail block email from php

January 12, 2015 1.8k views

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

<?php
        $headers = 'From: contact roudner.com <contact@roudner.com>'."\r\n";
        $headers .= 'Bcc: Me <me@server.com>; Him <Him@server2.com>'."\r\n";
        $headers .= "\r\n";
         if(mail(XXXX@hotmail.com", "subject", 'From: user@domain.com', $headers) &&
            mail("XXXX@gmail.com", "subject", 'From: user@domain.com', $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 :

127.0.0.1 localhost.localdomain localhost yourhostname

....
....
4 comments
  • 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 outlook.com and hotmail.com.

Be the first one to answer this question.