mail() only working for .com recipients?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wojtek.galaj
Forum Newbie
Posts: 1
Joined: Mon Jan 26, 2009 6:23 am

mail() only working for .com recipients?

Post by wojtek.galaj »

Hello everyone,

I have been breaking my head over this for a couple of hours now and I am absolutely stuck. I really need help :)

I have a simple sendMail.php file on my server. Here's the code:

Code: Select all

 
<?php
$sendTo = "xxx@xxx.com";
$subject = $_POST["referencia"];
$headers = "From: " . $_POST["nombre"] . "<" . $_POST["email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = "Formulario " . $_POST["referencia"] . "\r\n" . "\r\n" .
            "Nombre: " . $_POST["nombre"] . "\r\n" .
            "eMail: " .$_POST["email"] . "\r\n" .
            "Telefono: " . $_POST["telefono"] . "\r\n" .
            "Coche: " .$_POST["coche"] . "\r\n" .
            "Comentarios: " .$_POST["comentarios"] . "\r\n";
mail($sendTo, $subject, $message, $headers);
?>
 
As You can see it's really simple. Thing is, it will work only for some recipients. If I put my gmail account in $sendTo everything is fine. I have also tried with hotmail. However, neither my yahoo.co.uk account not my private .es mail recieves anything. I'm led to believe only .com domains recieve that mail? Does that make sense?

:banghead:

I dire need of some assistance...
Wojtek
Post Reply