Solved

mail() function not working with hotmail

Posted on 2006-11-30
12
296 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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
 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cisco 2960 unable to add SFP modules to device 9 68
Connectivity issues after power outage 5 35
VPN Ports 8 33
Programming Language for Wordpress 7 42
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

820 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