php Mail function classified as "Junk mail"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
polosport6699
Forum Commoner
Posts: 35
Joined: Wed Jun 11, 2003 3:19 pm

php Mail function classified as "Junk mail"

Post by polosport6699 »

I am using the php mail function, and my emails that I am sending are getting classified under outlook as Junk Mail, how do I get aroudn this so that my emails are viewable by all?

Here is the code i am using

Code: Select all

$to = "jnarowski@comcast.net";
$headers = "From: service@amishtables.com\r\n";
$headers .= "Reply-To: service@amishtables.com\r\n";
$headers .= "Return-Path: service@amishtables.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$message = "<html><body>";

$message .= "<img src=\"http://www.amishtables.com/images/headings/heading".$imagechoose.".jpg\"><br><br>";
$message .= $body2;
$message .= "</body></html>";

if (isset($Submit)) mail($to,$subject,$message,$headers);
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

we've discussed this before here:
viewtopic.php?t=34692
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: php Mail function classified as "Junk mail"

Post by Roja »

polosport6699 wrote:I am using the php mail function, and my emails that I am sending are getting classified under outlook as Junk Mail, how do I get aroudn this so that my emails are viewable by all?
Every site has different criteria for categorizing as Junk Mail.

Your best bet is to get a copy of an email that has been categorized that way and look at the headers. Most filtering software (Spamassassin,etc) adds headers that explain (or at least mention) which criteria the email met to become Junk Mail.

It could be any number of things from the fact that its html email, to the fact that you set both the reply-to and the return-to, content, ip range you sent it from, style, anything..

I had a perfectly legitimate site on a hosting company that sent out an email and it hit an RBL for the upstream of MY hosting company - two levels up the blacklist had added an entire netblock of *thousands* of PC's, so it had nothing to do with my emails.

So my advice, get the headers of a Junked email to learn why.
Post Reply