Email Spam Prevention – How to Prevent Mail Being Marked as Spam

debianemailruby-on-railssendmailspam

This is a canonical question about avoiding outgoing mail being classified as spam.
Also related:

I'm wondering how to prevent my emails from my site being marked as spam? I'm using sendmail.

I'm trying to send emails through my ruby-on-rails application. The mails are all written in swedish (if that does make a difference?). I don't know why they keep getting marked as spam.

Are there any things that I can do to minimize the risk?

Best Answer

Mail will be marked as spam by major ISPs (including webmail providers like gmail, hotmail, yahoo) for several possible reasons:

  1. If you're sending it from a residential IP address
  2. If you're sending it from an IP address with a poor reputation
  3. If you're sending mail which matches certain patterns (these are hard to describe, but software looks for things like "Congratulations, you've won $1 billion!", in a fuzzy-matching sort of way).
  4. If you send too much mail to the ISP too fast
  5. If too many people at the ISP click the "This is spam" button on your emails
  6. If you don't use SPF to identify which mail servers for your domain may send email, and which servers may not
  7. If you don't use DKIM to sign your messages
  8. If you haven't requested permission to be a "bulk sender" (some offer this like AOL and hotmail)
  9. If you IP address is on any DNS blocklists

and many, many other possible reasons.

You can check the reputation of your IP address at https://www.senderscore.org/
You can check if you're on various blocklists at http://www.mxtoolbox.com/blacklists.aspx