PDA

View Full Version : php mail() and hotmail :/


Nocashvalue
13-06-2007, 11:27 PM
Basically, I want to use php to email a validation email to people.
here's what I'm using:

//Defines subject and message
$subject = "subject";
$message = "message,
blah blah
blah
etc";

//emails the message
mail($email, $subject, $message, "From: sender<email@blah.com>\n");


which is all fine and dandy, except hotmail doesn't like receiving anything sent from it, and it really is only hotmail :/

any ideas chaps?

Bewildebeast
14-06-2007, 12:01 AM
http://www.webmasterworld.com/forum88/971.htm

Plenty more on Google (http://www.google.com/search?q=php+mail%28%29+hotmail)

Nocashvalue
14-06-2007, 12:19 AM
all the google results seem to have exactly the same problem for me :(

Timmeh
14-06-2007, 12:25 AM
Explode out $email with @, if it's hotmail.com or hotmail.co.uk, post to self "Sorry won't send to hotmail, sod off etc". Simple code and way around the problem, don't think many people have just hotmail addresses now.

Lewiji
14-06-2007, 07:41 AM
Is it being filtered into the spam folder? You've probably checked already but worth a try :p

Google suggests it's either because you're not conforming to MIME standards (in which case you should download a MIME class such as http://www.phpclasses.org/mimemessage)

It could also be that reverse DNS isn't set up correctly on your domain.

Edit: Just some code I googled.

$to = "someone <some@email>";
$subject = "You've got mail!";
$message = "Hello someone.";
$headers = "From: me@mysite.com\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Reply-To: me <me@mysite.com>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSmail-Priority: High\n";
$headers .= "X-mailer: My mailer";

Scuffles
14-06-2007, 08:44 AM
My guess from having worked with it (hotmail will happily recieve mail without full MIME encoding, no matter what Mr Google says on the matter), it's either to do with your reverse DNS (as previously mentioned), though this is only likely if you are sending from your own computer and have a SMTP server on localhost; the other problem may be if you're trying this on your website, and your host has a single SMTP server it uses for all domains, it can easily be blocked by hotmail for spammage.