email sent directly to spam box

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
choubix
Forum Commoner
Posts: 42
Joined: Tue Nov 06, 2007 12:21 pm

email sent directly to spam box

Post by choubix »

hello,

I am using swift on my website.
I think I have been setting it up correctly yet my emails end up in the spam box of the receivers each time (yahoo, hotmail...)

can someone help me out please?

i have activated the reverse dns, I have a spf record, I am using both html and text in the email.
this is an example

Code: Select all

 
        //email here
        require_once "../includes/mailer/Swift.php";
        require_once "../includes/mailer/Swift/Connection/SMTP.php";
        require_once "../includes/mailer/Swift/Authenticator/LOGIN.php";
        require_once "../includes/mailer/Swift/Plugin/Decorator.php";
        
        //Start Swift
        $smtp = new Swift_Connection_SMTP("smtp.mydomain.com");
        $smtp->attachAuthenticator(new Swift_Authenticator_LOGIN());
        $smtp->setUsername("mylogin");
        $smtp->setPassword("mypassword");
         
        $swift = new Swift($smtp);
        
        $message = new Swift_Message("{fname} {lname} has sent you a gift!");
 
        //Create the message
        $message->attach(new Swift_Message_Part("Plain text here"));
 
        $message->attach(new Swift_Message_Part("HTML Part, using hte Decorator", "text/html"));    
        
        
        $replacements = array(
        "$email1" => array("{fname}" => "$fname", "{lname}" => "$lname", "{password}" => "$password_temp1"),
        "$email2" => array("{fname}" => "$fname", "{lname}" => "$lname", "{password}" => "$password_temp2"),
        "$email3" => array("{fname}" => "$fname", "{lname}" => "$lname", "{password}" => "$password_temp3"),
        "$email4" => array("{fname}" => "$fname", "{lname}" => "$lname", "{password}" => "$password_temp4"),
        "$email5" => array("{fname}" => "$fname", "{lname}" => "$lname", "{password}" => "$password_temp5") 
        );
 
        //Load the plugin with these replacements
        $swift->attachPlugin(new Swift_Plugin_Decorator($replacements), "decorator");
         
        //store emails in an array, loop the array (prevents a problem: when one email is empty => error and header is not sent...) 
        //works: $array = array("$sendmail1"=>array("$email1"));   
        $array = array( 
                        array("$sendmail1", "$email1"),
                        array("$sendmail2", "$email2"),
                        array("$sendmail3", "$email3"),
                        array("$sendmail4", "$email4"),
                        array("$sendmail5", "$email5")
                        );  
         foreach($array as $key=>$value)
            {
                if(!empty($value[0]))
                {
                $swift->send($message, "$value[1]", "webmaster@mydomain.com"); 
                print_r($value[1]);
                }
            }
        
        $swift->disconnect();
 
this is just one example, all the emails sent from the website end up in the spam box... :(

hope someone here can help.

Thanks! :)
Alex
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: email sent directly to spam box

Post by Chris Corbyn »

What's the name of your SMTP server? Have you checked you're not blacklisted?
choubix
Forum Commoner
Posts: 42
Joined: Tue Nov 06, 2007 12:21 pm

Re: email sent directly to spam box

Post by choubix »

hello chris, thanks for reading me

the website is: http://www.zeelotto.com
smtp is smtp.zeelotto.com

doesnt seem like I have been blacklisted already :(
maybe a problem in the headers??
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: email sent directly to spam box

Post by Chris Corbyn »

What do your emails have in them? If I were a computer program who looked for spam, that website would look like spam to me... Just the fact it's got the words "Lottery", "100%" and "Free" in the title is spam like (from a bot's perspective). If your emails are structured the same way I can probably just put it down to the email being too much like spam.

It won't be a header's issue if you haven't changed the headers yourself ;)
choubix
Forum Commoner
Posts: 42
Joined: Tue Nov 06, 2007 12:21 pm

Re: email sent directly to spam box

Post by choubix »

hummm

email is structured like this:

i use the words: win, prize, free 2x in the email. 1 ! mark only.

since i do not intend to spam the users is there anything i can do??
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: email sent directly to spam box

Post by Chris Corbyn »

Do you have many links to the website in the email too?

Without seeing the email I can't really judge. Also, is the plain text version exactly the same as the HTML version in terms of content?

I'm not sure you can easily send an email regarding that website without it looking like junk... What are these emails for exactly? Marketing?
choubix
Forum Commoner
Posts: 42
Joined: Tue Nov 06, 2007 12:21 pm

Re: email sent directly to spam box

Post by choubix »

aie: i don't have access to the files right now.

basically this email is sent by the users of the website to their friends.
i create a temp account for them.

I intend to limit to 4 the emails sent through the smtp server (creation of account, information on the points and prizes won, recommendations from friends, general information)
this email should have a link to the website indeed. from the top of my head maybe it's used once or twice.

in short: the content makes it look like a spam...

next project is not lottery related
that should make it easier for the emails to be sent/received in the mailbox!! :)
Post Reply