Solved

mail() function not working with hotmail

Posted on 2006-11-30
12
297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to join another Exchange server to a network, across a WAN 9 26
calculate days away 11 59
autocad mechanical 2014 installation issue 5 65
hsrp tracking 2 54
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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…

738 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