Why my website emails go to SPAM box?

23,716

Solution 1

ensure you have an SPF record associated with your domain, have a look here : http://support.google.com/a/bin/answer.py?hl=en-uk&hlrm=en&answer=33786

Solution 2

Gmail filters emails based upon

  • their content
  • the email receivers behaviour

The content should not have words like "payment, money, mlm, oppurtinity, bank, money". Every spammer who wants to reach success, will say what people want to hear, and theese are exactly theese things.

Also, if there are too many people marking your email as spam, then after a certain amount+percentage combination of negative "votes" your email address will be marked as unsafe.

Share:
23,716
Ivan
Author by

Ivan

After half-life programming computers in C/C++ and assembly, in 2009 I changed radically and started a new life as LAMP programmer. Now I'm in love with web programming.

Updated on February 03, 2020

Comments

  • Ivan
    Ivan over 4 years

    All emails that my site is sending are going to SPAM box in Gmail (I haven't tested other email servers).

    I'm sending emails through Gmail using my own domain (via Google Apps). I send the emails using the PHPMailer library:

    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = "ssl";
    $mail->Host = "smtp.gmail.com";
    $mail->Port = 465;
    $mail->Username = "[email protected]";
    $mail->Password = "mypassword";
    $mail->From = "[email protected]";
    $mail->FromName = $websiteName;
    $mail->Subject = $subject;
    $mail->AddAddress($to, "Client");
    if ($html) {
        $mail->MsgHTML($content);
        $mail->AltBody = strip_tags($content);
        $mail->IsHTML(true);
    } else {
        $mail->Body = $content;
    }
    if (isset($options['content-type'])) {
        $mail->ContentType = $options['content-type'];
    }
    if (isset($options['charset'])) {
        $mail->CharSet = $options['charset'];
    }
    
    return $mail->Send();
    

    The email is sent as expected, but always falls into SPAM box. It happens in emails that contain HTML and in emails that are raw text like this:

    Hello John Smith,

    Thank you very much for trusting us.

    To finish your purchase you should deposit XX USD to the account number:

    IBAN XXXX - XXXX XXXX XX XX XXXXXX

    Once we receive your transfer, we will activate your license and send all documents by e-mail (a copy of the contract, invoice, user guide concerning the application). You have 15 days to review all the material and the application itself and if you are not fully satisfied with the product you purchased, we will refund your money.

    If you need some agent's help you can reply this email.

    Greetings

    Well this message may be contains some words that could activate the SPAM filter, but it also happens with messages like this:

    Hello

    You have a new message in your inbox:

    Meeting about next holidays (17:40-18:20).
    

    We hope to see you soon!

    http://example.com/

    What's wrong? What's the best strategy to send emails through gmail without being penalized?

    • Chris Laplante
      Chris Laplante over 11 years
      It's pretty simple, actually - the emails you are sending look like spam. There is no way to assure the server that it isn't spam - otherwise every spammer on earth would do it. The solution is to send different content.
    • Bob Kaufman
      Bob Kaufman over 11 years
      Here's an article written by one of StackOverflow's founders, Jeff Atwood, on this subject: codinghorror.com/blog/2010/04/…
  • Ivan
    Ivan over 11 years
    At the moment I'm the only user.. but are you sure about this? Because most of my emails comes from a "calendar" and the expected user behaviour is to delete the email after read it (it's just a "remember this" notification)