How to stop Gmail from marking mails sent by my web app as spam?

elan picture elan · Dec 16, 2008 · Viewed 28.9k times · Source

I have a simple web application that provides daily financial data. Users subscribe, and we send them an email every day. However, Gmail is marking all of our emails as spam. What should we be looking out for?

Answer

MarkR picture MarkR · Dec 16, 2008

Chiefly, to avoid a spam engine classifying your messages as spam you should:

  • Make sure they aren't spam (i.e. ensure that only users who have really opted in get mailed - make sure you keep an opt-in audit log)
  • Make sure they don't look too much like spam - $$$ MAKE MONEY FAST is not a good subject line
  • Ensure that the sender address is not spoofed and does not appear to be spoofed. Use a domain that you are authorised to send from (add valid SPF records if you like)
  • Not do anything that looks malware-ish (e.g. HTML emails containing scripts, forms, flash etc)

But by and large the main one is:

  • Do not send them from an IP address which is known for sending spam.

The last point means that YOU CANNOT USE SHARED HOSTING. Almost all shared hosting providers allow the sending of mails which don't conform to any of the above. Shared hosting providers' relays are almost always on lots of blacklists.

It only takes one vulnerable web app on your shared hosting for it to turn into a spam gateway - something which you can't afford.

EDIT: Oh yes - if you're not setting the envelope-sender, your hosting provider may have it set to something stupid - ensure that you do set it to the same as From: - this makes sure that your messages aren't seen as spoofed