View Full Version : Why is hotmail rejecting php emails - mail()

12-06-2003, 04:53 AM
this is the code i'm doing:

$to = " $_POST[nick1] < $_POST>";
$subject = "Verify your account";

$message = '
Hello '. $_POST['nick1'] .',
Welcome to dEVLE wORM. All you have left to do is follow the link below.<br>
http://domain.com/verify/?id='. md5($_POST[nick1]) .'<br>
Once your email is verified your account will be activated and you will be able to login.<br><br>



$headers = "From: domain.com <noone@domain.com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain;"\n";
$headers .= "Reply-To: domain.com [email]noone@devleworm.com>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSmail-Priority: High\n";
$headers .= "X-mailer: domain.com";

mail ($to, $subject, $message, $headers);

hotmail and yahoo don't even show the email, if they do it is in junk mail.

12-07-2003, 07:00 PM
Assuming your domain is not on some sort of blacklist it may be finding something wrong with your headers, or you have sent too many to the address at one time.

Yahoo and Hotmail seem to react well to these set of headers:

$headers="Subject: $subject\r\n";
$headers.="From: $myemail\r\n";
$headers.="To: $toname <$toemail>\r\n";
$headers.="X-Sender: <$myemail>\r\n";
$headers.="Return-Path: <$myemail>\r\n";
$headers.="Errors-To: <$myemail>\r\n";
$headers.="X-Mailer: PHP\r\n
$headers.="X-Priority: 3\r\n";

This is not including the content header which you can include based off your own content. I leave out
$headers .= "X-MSmail-Priority: High\n";

because spamassain will grab it. It detects that it appears to be faking outlook and that is worth several points on the spam point scale.

Though I think likely you just have to find the right combination of headers