php mail() goes to junk folder!

Soldato
Joined
18 Oct 2002
Posts
9,047
Location
London
I'm aware you can get premade php mailing classes, but I'm stubborn and want to get it to work without all that...
Whenever I send an email to my hotmail address it goes in the junk folder which I don't want. I don't understand why though.. Are my headers wrong?
Here's a snippet:

Code:
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: [email protected]' . "\r\n";
$headers .= 'Reply-To: [email protected]' . "\r\n";
$headers .= 'Return-Path: [email protected]' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";


	// prepare email body text
	$Body = "";
	$Body .= "Message: ";
	$Body .= $Message;
	$Body .= "\n";
	
	// send email 
	$success = mail($EmailTo, $Subject, $Body, $headers);

I'd appreciate any help on this! :)
 
Thanks for the tip with the /r, however it still goes in the bin :(

I did google some, hence all the headers I've accumulated hoping it would solve the problem! But nothing seems to get through. I even tried changing every mention of an email address to this format:

Code:
$EmailTo = 'XYZ <[email protected]>';

But no good! What can I be possibly be missing that hotmail needs?
 
Back
Top Bottom