Forum Moderators: coopster

Message Too Old, No Replies

PHP Mail() going to yahoo bulk folder

         

babloo

5:04 am on Jun 18, 2004 (gmt 0)

10+ Year Member



Hello,

I have got a small problem with the php mail function. When I send mail to my yahoo account using mail function, it is going to the bulk folder instead of the inbox. I have included all the headers for the mail to function.

This is the code I have used.

$to = "to@domain.com";
$subject = "Test Subject";

$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: MyName <MyEmail>";

$msg = "Test Message";

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

Thanks

Marcia

5:12 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it's automatically going into the bulk mail folder, it could be a Yahoo Webmail filtering issue. That can easily happen even if someone accidentally hits the "spam" button instead of the "delete" button in their account.

Try putting an OK on that domain from within your Yahoo mail and see if it works.

outrun

5:31 am on Jun 18, 2004 (gmt 0)

10+ Year Member



Hotmail and yahoo sometimes set off filters with emails that don't come from the same domain, if you are on shared hosting this can be a problem becuase as the header will say it was sent via yourhost.com which can be different from the domain part of your email which could be myemail@mydomain.com.

regards,
Mark

babloo

5:35 am on Jun 18, 2004 (gmt 0)

10+ Year Member



I am not facing problem with hotmail. I am assuming that some headers are missing in the code which makes the message being filtered by yahoo and send it to the bulk folder.

outrun

5:59 am on Jun 18, 2004 (gmt 0)

10+ Year Member



Try making the priority of the email to high this may help to get through mail filters the syntax would be as follows.

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

Place these after you set the content type.
regards,
Mark

jatar_k

5:36 pm on Jun 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



pretty much mail just sucks but I have spent a lot of time on this recently so I will give you the rundown

these are the specific headers and the order is important I had a few problems with some clients doing strange things with various other orders

$headers = "From: " . $corpname . " <" . $sourceemail . ">\r\n";
$headers .= "Return-Path: " . $sourceemail . "\r\n";
$headers .= "Reply-To: " . $sourceemail . "\r\n";
$headers .= "Content-type: text;\r\n";
$headers .= "Mime-Version: 1.0\r\n";
$headers .= "X-Mailer: PHP Mailer\r\n";

We run every email through an external site (one of our home boxes) and set spamassassin to add the x-spam-status header at anything with a rating above 0. We then go through all the resulting spam flags and correct content or whatever needs to be removed. We presently have the majority of our emails going out at a spam rating of 0, I haven't had time to finish all of them yet.

We also had some issues with reverse lookups on the IP adresses that send out mail and had to work with our provider to get that sorted so they would work properly.

That gets most of them in, we have accounts with all of the popular webmail providers as well and take a look at all the emails in there and see where they end up.

Email really is a pain.