R – when using Zend_mail the emails seem to be treated as spam, send through outlook and there not

zend-frameworkzend-mail

I'm trying to sort out an opt in mailing list system. I understand the basic principles and design required but i'm having an issue with it being picked up as spam.

If i send a html email through outlook through email@domain.com it works fine and is not treated as spam. When i use the Zend_mail object to send mail it sends but is treated as spam on the test emails accounts i'm sending it too.

This is the code im using to send an email item.

//send an email
        $mail = new Zend_Mail();
        $config = array('auth' => 'login','username' => 'email@domain.com','password' => 'mypassword');
        $transport = new Zend_Mail_Transport_Smtp('mail.domain.com', $config);
        $mail->setSubject($item->title);
        $mail->setFrom("email@domain.com");
        $mail->addTo($item->email, $item->forename);
        //$mail->setBodyText($item->contentPlain);
        $mail->setBodyHtml($item->contentHTML);
        $mail->send($transport);

As you can see im using the smtp transport object to authenticate but it still seems to treat this as spam. Anyone with pointers or tips is very much appreciated!!

Header info from the email that is treated as spam:

It seems to contain a couple of client domain names in the header info that i host for people any ideas why that would be the case? I use a shared IP address with about 10 domains on it

    Received: (qmail 1436 invoked from network); 14 Aug 2009 16:02:10 +0100
    Received: from clientdomain1.co.uk (HELO localhost) (91.192.***.196)
  by clientdomain2.info with SMTP; 14 Aug 2009 16:02:10 +0100
Subject: Manchester 2 Day Seminar: Dealing with difficult people
From: events@domain.com
To: Andi <subscriber1@domain.com>
Date: Fri, 14 Aug 2009 15:02:10 +0000
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
MIME-Version: 1.0

Best Answer

"Roll your own mail" is often treated as spam by large hosted email systems. When you use a paid service to send out mass emails, you are paying for those company's agreements with the major email vendors to keep them white-listed.

One thing you can do, though, is to ensure that the account you are sending from exists and the email is being sent from a matching domain (e.g. @foo.com sent from foo.com's smtp server). That is a big red flag for spam filters.

Related Topic