• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

mail() function not working with hotmail


It's me again, trying to get some answer from you guys. I hope I get some answer to this weird problem.

I have tried several codes, modified several codes, etc. I can send an email to any webserver, but not to hotmail, why?

This is the code I'm using right now:

$to = $_POST["email"] ;
$from = "fotos@limapoint.com" ;
$name = $_POST["nombre"] ;
$asunto =  $_POST["nombre"]  ;
$subject = "Has recibido una fotografía.";

      $imag='<img src="http://www.limapoint.com'.$_POST["cuerpo"].'"><br><br>';
      $body = '
    <img src="http://www.limapoint.com'.$_POST["cuerpo"].'">
     Para ver las demás fotografías de este evento haz click <a href="http://www.limapoint.com">AQUI</a>
       O visita <a href="http://www.limapoint.com">www.limapoint.com</a>

  $headers = "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";  
  $headers .= "Content-Transfer-Encoding: 7bit\r\n" ."Message-ID: \r\n";  
  $headers .= "From: Limapoint.com <fotos@limapoint.com> \r\n";
  $headers .=  "Reply-To: Limapoint.com <fotos@limapoint.com>" . "\r\n" .
  $headers .=   "X-Mailer: PHP/" . "phpversion()";
      //Conexion con la base
    mysql_db_query($dbname,"insert into contactos (nombre,mail,asunto,mensaje) values ('fotopoint','$email','','$imag')");

$send = mail("$to", "$subject", "$body", "$headers");

echo "estado=Mensaje enviado.";


I added a lot of headers because from the posts I looked, Hotmail was requiering this stuff. I also tried to delete those headers and send the email, but no luck.

The server IP is not on the black list of hotmail (I already checked that), I have a forum on this server and all the registration, password request, validations, are sent correctly to hotmail. But my little mail() function is not working with Hotmail.

Any ideas?
  • 5
  • 3
  • 2
  • +1
1 Solution
Possible Reverse DNS issues. Check out this http://www.webmasterworld.com/forum88/11414.htm
AsheronAuthor Commented:
How do I verify if the Reverse DNS is ok or not?

If it's not, how can I fix it? (My server uses CentOS with WHM/cPanel)
The reason it is not sending mail to hotmail.com is because Hotmail is identifying it as spam. Hotmail uses a technology called Sender ID to validate the authenticity of emails. To resolve the issue, use a SPF (Sender Policy Framework) Wizard such as this one:

It will ask you some questions and give you a line of text that you need to place in the TXT portion of your DNS record. If you browse through the options provided by your domain name registrar, you should see a section titled TXT. My domain name registrar, godaddy.com, has a wizard built into the DNS Management tools. Good luck!
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Also, you need to remove the double quotes around phpversion() in the following line:
$headers .=   "X-Mailer: PHP/" . "phpversion()";
You might also need to add X-Originating-IP. This header comes with all Hotmail originating messages.
AsheronAuthor Commented:
I just tried that. Not working.

voxelz, maybe you can check the SPF record that is showing now? This is totally new to me, so maybe I did wrong the setup.
AsheronAuthor Commented:
Here is my DNS Zone

There were errors in the new zone which have been highlighted below, please press the back button an try again!

; Modified by Web Host Manager

; Zone File for limapoint.com

$TTL 14400

@      14440      IN      SOA      ns.sourcedns.com.      support.sourcedns.com.      (







limapoint.com.      14400      IN      NS      ns.sourcedns.com.

limapoint.com.      14400      IN      NS      ns1.sourcedns.com.

limapoint.com.      14400      IN      A

localhost.limapoint.com.      14400      IN      A

limapoint.com.      14400      IN      MX      0      limapoint.com.

mail      14400      IN      CNAME      limapoint.com.

www      14400      IN      CNAME      limapoint.com.

ftp      14400      IN      A

limapoint.com.      14400      IN      TXT      v=spf1 a mx ptr ip4: mx:limapoint.com ip4: ip4: -all

mail      14400      IN      TXT      spf2.0/pra ?all

For some reason, it wont let me put the last line, because it says this:
mail.limapoint.com: CNAME and other data

Any ideas?

get the ip address of the web server and go to dnsstuff.com and type the ip address to get a PTR for the ip address. if it says there isn't one, then this is probably the problem :)
AsheronAuthor Commented:
You are correct. It doest not exist. How can I fix that?
Contact the Web hosting provider and ask them to do it as they have access to do it.
Once done, you may want to allow upto 24hours for replication. (probably less)
AsheronAuthor Commented:
The host is telling me that I have to change my account to a VPS. Or something like that,  they just don't want to help me.

Thank you for the help, I will try to split the points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now