1

I am using the following PHP CODE to send BULK MAIL .But Mails seems to Land in SPAM.I am using "phpmailer" class to send the mail.

require 'mailer/class.phpmailer.php';
$mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->SMTPAuth   = true;
    $mail->SMTPSecure = "ssl";
    $mail->Host       = "smtp.gmail.com";
    $mail->Port       = 465;
    $mail->Username   = "info@gmail.com";
    $mail->Password   = "Bexwa44Puciz";       // GMAIL password
$mail->AddReplyTo('info@gmail.com', 'Info');
$Appname = 'info.com';
$_subject="Newsletter From: ".$Appname;
$ema=",";
    $to_bcc=explode(",",$ema);
$mail->AddCustomHeader($headers); 
foreach($to_bcc as $tb){
    $mail->AddBCC($tb, $dname);
}
$_body ="News content";//$hid;
$mail->FromName = "info.com";
    $mail->From="inf@gmail.com";
    $mail->Subject = $_subject;
    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
    $mail->MsgHTML($_body);
    if($mail->Send()){ 
    echo "Done"; 
}else {
    echo "Failed";
}
j0k
  • 22,600
  • 28
  • 79
  • 90
Praveen
  • 11
  • 5
  • 1
    Bulk mails are spam so everything is OK. alos please see http://stackoverflow.com/questions/4545648/why-is-my-bulk-email-being-flagged-as-spam – fsw Feb 08 '13 at 11:06
  • 1
    Some (/ most?) spmafilters add custom headers to the mail with how the spamscore was calculated. Inspect it. – PeeHaa Feb 08 '13 at 11:07
  • You are probably spoofing your from e-mail address. That's why most spam filters will mark it as spam. – Bram Verstraten Feb 08 '13 at 12:09

2 Answers2

1

I experienced same. My website sends requests for data confirmation to users a few times each day while I do my daily data maintenance. I sent a test message to my Gmail address and found that if you read your mail through Gmail webmail interface it will sometimes tell you Why the message was spammed. Very useful. It gave the reason "A lot of messages from hp19.hostpapa.com were spam". I am on a budget shared server and I assume a hundred other spammers have bought accounts on the same machine as mine and are using it for evil. My site is non-profit so buying a dedicated box to avoid spam is not an option. So...

My solution was to change my CMS to not use PHP mail() at all. Now my CMS simply displays the message and a mailto: link with Subject parameter set. Now my process is to hit CTRL+C, Click the link, CTRL+V, and hit send. Messages are sent from my computer's IP Address (not on any blacklist) using my mail client, Thunderbird.

This takes me just a couple of seconds longer than it did when my CMS used PHP mail() to send the message for me. However I have found I am receiving a lot more replies so I am happy that the vast majority of messages are not getting spam-binned.

I appreciate this manual solution is not appropriate for automated bulk messaging but for small non-profit sites on shared server who trigger each message with a click, I thought it was worth sharing.

Martin Joiner
  • 3,529
  • 2
  • 23
  • 49
0

There are a number of reasons you could be going into someones spam box. Your email server could be blacklisted due to either you, or another user on your server. You can check it at http://mxtoolbox.com/blacklists.aspx

Also check your SPF records in your DNS