Basicly I am trying to write this mail script to send out a confimation. Initally it was recieved by all the e-mail accounts I am testing with. (Gmal, Hotmail). But in hotmail, and other free accounts (Yahoo included) it would aprear as junk mail. So I modifed the code a little. I added
$headers .= "Reply-To: [email]accounts@somesite.com[/email]\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
Now it will send to Hotmail, as not Spam. But gmail refuses to receive it. I also tried using the 5th option in mail, but the server is in safe mode, and I can't use that option.
I also tried to remove the /r/n and just use /n as stated on php.net. But then hotmail then neither would recieve the messege.
Suggestions?
// SEND CONFIRMATION E-MAIL
//$message .= "Content-Disposition: inline; filename=\"$theFile\"\n\n";
//add From: header
$headers = "From: Accounts <accounts@somesite.com>\r\n";
//Other Stuff to Try to Avoid Spam Filter
$headers .= "Reply-To: [email]accounts@somesite.com[/email]\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";
//unique boundary
$boundary = uniqid("CONFIRMMAIL");
//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";
//message to people with clients who don't
//understand MIME
$headers .= "This is a MIME encoded message.\r\n\r\n";
//plain text version of message
$message .= "Non HTML Confirmation Messege\n";
$headers .= "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($message));
//HTML version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("
HTML Version of Confirmation
"));
//send message
mail($email, "Registration Confirmation", "", $headers);
//END SEND CONFIRMATION EMAIL