问题
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 = "myuser@example.com";
$mail->Password = "mypassword";
$mail->From = "noreply@example.com";
$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?
回答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
回答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.
来源:https://stackoverflow.com/questions/14664033/why-my-website-emails-go-to-spam-box