View Full Version : forms emailing to hotmail inbox..

04-10-2003, 07:26 AM
Testing this code to create a simple mail script to send across to a hotmail account, however, it always sends it to my junk folder. Is there any way of guaranteeing that it will send an email to the inbox instead? I'm testing with a hotmail and yahoo account.

I'm using what someone suggested on the php.net website:

$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";

and it still doesn't work, goes straight to my junk mail.


04-10-2003, 07:34 AM
Well it's not really going to be a php issue. You would have to find out why hotmail's spam filters are sending to the bulk/junk folder. There could be many reasons why it's getting flagged as spam. Maybe your host's server has been flagged by hotmail as sending spam, maybe something in your subject line is getting flagged. Do you have any of your own filters set on your hotmail account? Hotmail may not like certain headers, find out what is acceptable from them.

04-10-2003, 01:29 PM
$to = $contactNameTwo." <".$emailTwo."> \r\n";

$headers = "From: ".$contactNameOne." <".$emailOne.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "Reply-To: ".$contactNameOne." <".$emailOne.">\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: php\n";

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

Where $contactNameTwo = "Receiver's Name"
$emailTwo = "Receiver's Email Addr"
$contactNameOne = "Senders Name"
$emailOne = "Senders Email Addr"

Hope it helps anyone else looking for a script that works.