Forum Moderators: coopster
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
Try putting an OK on that domain from within your Yahoo mail and see if it works.
regards,
Mark
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.