Hi,

I have a newsletter script . The script sends a MIME e-mail to about 150 addresses . When I add a logo, the HTML email get a spam-level of 5, and recipients using antispam don't receive the email. The header of the email looks like this :

X-Spam-Score: 4.908 (HTML_IMAGE_ONLY_04,HTML_MESSAGE,MISSING_DATE,MSGID_FROM_MTA_ID)
X-Spam-Level: !!!!
X-Antivirus: AVG for E-mail 7.5.446

Do you have any idea to avoid this span level?

here is the code I use to send the email :

$headers = array (
	'From' => " <" .$from.">",
	'To' => $to,
	'Subject' => $subject);

$mime = new Mail_mime($crlf);
$mime->setTXTBody($txt);
$mime->setHTMLBody($html);
$mime->addHTMLImage('/logo.gif', 'image/gif');

$msg = $mime->get();
$headers = $mime->headers($headers);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => 587,
'auth' => true,
'username' => $username,
'password' => $password,
'timeout' => 30)
);
$mail = $smtp->send( $to, $headers, $msg);
    1. Ensure that you send all appropriate headers. This can be done (typically) by sending via a proper MTA rather than with SMTP directly
    2. Ensure that your MTA has a reverse DNS which resolves to something sensible, and the forward DNS for that name is correct too.
    3. Make sure that the domain you're using for your "From" and "envelope sender" headers allows mail from that host name / IP if SPF is enabled.
    4. Don't forge the "From" or "envelope sender" headers under any circumstances.

    Then it should all work.

    Mark

      Some of MarkR's suggestions are hinted at in the reasons given for the high score and dealing with those could help. Viz,

      HTML_IMAGE_ONLY_04: HTML: images with 0-400 bytes of words (Score 2.880)
      HTML_MESSAGE: HTML included in message (Score 0.001)
      MISSING_DATE: Missing Date: header (Score 1)
      MSGID_FROM_MTA_ID: Message-Id for external message added locally (Score 0.927)
      (No, I don't know where the other 0.1 score comes from; different version/configuration/weights).
      The same site provides further tips for avoiding false positives.

      Ultimately, of course, there is no 100% guaranteed method to avoid being identified as spam - if there was, spammers would use it. But generating a quality email goes a very long way.

        I just would like to get ride of the HTML_IMAGE_ONLY_04 tag. And I don't really understand what image with 0-400 bytes words means.

        Any hint about that??

        Louis

          If I had to make a wild guess (seeing as I didn't write that message) it would be that the HTML page uses an image that is less than 400 bytes in size.

            Weedpacket, I think that spam score comes from using an image in an email with less than 400 bytes of text (rather than the image being less than 400 bytes).
            You could try adding a footer to the email to pad it out.

              Yeah, I was wondering what the "of words" bit meant. Probably be better written as "of text". I was thinking "words" as in 32-bit words.

                Write a Reply...