...

View Full Version : Mail problem with Hotmail



guvenck
03-09-2007, 01:21 PM
Hi,

When I investigated a site I've built, I've found out that nearly half of the users did not activate their account. I've digged deeper and found out almost %90 of these non-activated users had applied for an account through their hotmail account.

It is obvious that hotmail users can't receive the activation mails I've sent through PHP mail function and therefore can't activate their accounts.

But, I also have activated users -not that many- with hotmail accounts. So, sometimes the mail goes through.

I've found on the net that many people had this problem.

This is a big problem as my client is asking me why this happens. Before I put the %100 blame to hotmail, I'd like to know if there is anything I can do to improve or guarantee to be accepted by the glorious MS Hotmail.

Here is my code, although I don't think anything is wrong. Yahoo or Gmail have no difficulties receiving this email.



$headers = "";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Return-Path: <system@myclientsdomain.com>\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "From: My Client <system@myclientsdomain.com>\r\n";
$headers .= "To: $name $surname <$email>\r\n\r\n";
$subject = "Your Activation";
$message = "";
$message .= "<html><head><title></title>";
$message .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">";
$message .= "</head><body>";
$message .= "<p>Dear $name $surname,</p>";
$message .= "<p>Thanks for signing up to our website!<br>";
$message .= "One last step is needed to activate your account.<br>";
$message .= "<p>Please click on the link below to activate:</p>";
$message .= "<p><a href=\"http://www.myclientsdomain.com/activate.php?op=activate&confirm=$token\">http://www.myclientsdomain.com/activate.php?op=activate&confirm=$token</a></p>";
$message .= "<p>Thanks!<br>";
$message .= "My Client</p>";
$message .= "<p>This is an automated message, please do not reply.</p>";
$message .= "</body></html>";

if (@mail($email, $subject, $message, $headers)) {
include ("header.php");
?>
<table width="100%" cellspacing="8" cellpadding="8" border="0">
<tr>
<td valign="top">
<h2 align="center">Thanks...</h2>
<p>Dear <?php echo "$name $surname"; ?>,<br><br>An activation email has been sent to the email address you provided.<br>
Please click on the link in this email to activate your account.</p>
<p><b>ATTENTION:</b> Some free email providers (Hotmail, Yahoo, Gmail...) forward email messages to their "Bulk", "Junk", "Spam" folders.<br>
If you think you did not receive our activation email in your inbox, please check the folders mentioned above.</p>
<p>Thanks,<br>
My Client</p>
</td>
</tr>
</table>
<?php
include ("footer.php");
}

CFMaBiSmAd
03-09-2007, 03:38 PM
About the only things I see from your code is I would not put the < > around the return-path email address (only use the < > when there is an alias <name> portion before the email address.) And, put a Reply-to: field.

If your email was ending up in the junk/spam folder at msn/hotmail, the most likely cause is the lack of an SPF record. If it is not being received at all, it is likely a problem with the configuration of your server's DNS records or the configuration of the mail server and/or your mail server has been banned by msn/hotmail or appears on spam databases that hotmail uses.

Here is a recent thread concerning getting email accepted - http://www.codingforums.com/showthread.php?t=108632

guvenck
03-09-2007, 07:59 PM
Hello, thanks for your reply. I can say the following:


nd, put a Reply-to: field.

I already have a Return-Path. Do I need a Reply-to field that bad?



(only use the < > when there is an alias <name> portion before the email address.)

Hmm, I have the name portion, which is, My Client, in this case.


$headers .= "From: My Client <system@myclientsdomain.com>\r\n";

CFMaBiSmAd
03-09-2007, 08:07 PM
I wrote -
I would not put the < > around the return-path email address

guvenck
03-11-2007, 03:02 PM
Got it :)

And I found out that the problem probably relates to the SPF record. Hotmail checks for SPF records since 2004. I instructed my hosting provider to add a SPF record for my domain and hope the problem gets solved.

guvenck
03-12-2007, 12:34 PM
Nearly all the emails sent to hotmail accounts are bouncing. This is the system message I am getting at my default email address:


This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

name_surname@hotmail.com
SMTP error from remote mail server after RCPT TO:<name_surname@hotmail.com>:
host mx1.hotmail.com [65.54.245.8]: 550 Requested action not taken:
mailbox unavailable

------ This is a copy of the message, including all the headers. ------

I don't think hundreds of users enter their email address wrong.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum