Solved

mail() function not working with hotmail

Posted on 2006-11-30
12
292 Views
Last Modified: 2013-11-30
Hello,

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:

<?php
$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>';
      $imag.=$_POST["asunto"];
      
      $body = '
    <html>
    <head>
    <title>Fotopoint</title>
    </head>
    <body>
    <br>
    <img src="http://www.limapoint.com'.$_POST["cuerpo"].'">
     <p>
     '.$_POST["asunto"].'
    </p>
     Para ver las demás fotografías de este evento haz click <a href="http://www.limapoint.com">AQUI</a>
    <br>
       O visita <a href="http://www.limapoint.com">www.limapoint.com</a>
    </body>
    </html>';

  $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()";
   
      include("../../../admin/nconfig.php");
      //Conexion con la base
      mysql_connect($dbhost,$dbuser,$dbpass);  
    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?
0
Comment
Question by:Asheron
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 15

Expert Comment

by:deepaknet
ID: 18051896
Possible Reverse DNS issues. Check out this http://www.webmasterworld.com/forum88/11414.htm
0
 

Author Comment

by:Asheron
ID: 18051902
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)
0
 

Accepted Solution

by:
voxelz earned 500 total points
ID: 18052100
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:
http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/

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!
0
 

Expert Comment

by:voxelz
ID: 18052129
Also, you need to remove the double quotes around phpversion() in the following line:
$headers .=   "X-Mailer: PHP/" . "phpversion()";
0
 
LVL 15

Expert Comment

by:deepaknet
ID: 18052136
You might also need to add X-Originating-IP. This header comes with all Hotmail originating messages.
0
 

Author Comment

by:Asheron
ID: 18053258
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.
0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 

Author Comment

by:Asheron
ID: 18055810
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.      (

                              2006111304

                              14400

                              7200

                              3600000

                              86400

                              )



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

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



limapoint.com.      14400      IN      A      209.59.168.168



localhost.limapoint.com.      14400      IN      A      127.0.0.1



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



mail      14400      IN      CNAME      limapoint.com.

www      14400      IN      CNAME      limapoint.com.

ftp      14400      IN      A      209.59.168.168

limapoint.com.      14400      IN      TXT      v=spf1 a mx ptr ip4:209.59.168.168 mx:limapoint.com ip4:209.59.168.2 ip4:209.59.168.168 -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?

0
 
LVL 5

Expert Comment

by:onlinerack
ID: 18058967
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 :)
0
 

Author Comment

by:Asheron
ID: 18059032
You are correct. It doest not exist. How can I fix that?
0
 
LVL 5

Expert Comment

by:onlinerack
ID: 18059061
Contact the Web hosting provider and ask them to do it as they have access to do it.
0
 
LVL 5

Expert Comment

by:onlinerack
ID: 18059062
Once done, you may want to allow upto 24hours for replication. (probably less)
0
 

Author Comment

by:Asheron
ID: 18064012
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Read about why website design really matters in today's demanding market.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
The viewer will learn how to dynamically set the form action using jQuery.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now