Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail is filtering my web app's email as spam [closed]

We have a business web application that periodically sends emails as reminders, links to client data, etc. Our company uses Google Apps for our email provider (with our own domain name), and the web application sends email through Google with SMTP.

The problem is that Google Apps / Gmail keeps marking the messages as spam, even for the inboxes in our domain name. No other email provider seems to mark it as spam (but of course we haven't tested them all...).

We've tried various formulations of the body test: i.e. including more contextual information, addressing the recipient by name, but so far with no apparent changes. This makes me thing it may be something about our email sending process, rather than the content of the email, that's causing the emails to be marked as spam.

Things that we tried but that didn't solve the problem:

  • "From" address is valid and not spoofed
  • SPF records are correct, and show as "pass" in the email header
  • Since we are connecting to Google's SMTP server to send email, it's not an issue with a blacklisted IP address (however, our website has a static IP address that is not blacklisted).
  • Email is not very spammy: I've checked against several online spam filter tests, and the email body always shows up as extremely unlikely to be filtered.
  • HTML body vs plain-text body seems to make no difference.
  • We send a small volume of email: probably 0-10 emails per day, so I don't see how that would make this suspicious.
  • Whenever we have access to the receiving inbox (i.e. it belongs to an employee of our company), we've been marking the emails as "not spam", since Gmail may be using communal statistics to determine spam. After a couple times this results in emails to that particular inbox getting through, but doesn't seem to help other accounts.

What else can we try?

If it makes a difference, we're sending emails using an ASP.NET site running .NET 3.5. A typical email gets sent like this:

var message = new MailMessage(new MailAddress(from), new MailAddress(to)) {
    Subject = subject,
    Body = body
    IsBodyHtml = true
};

// SMTP details stored in web.config 
new SmtpClient { EnableSsl = true }.SendAsync(message, null);

EDIT: I've seen this similar question: How to stop Gmail from marking mails sent by my web app as spam?, but the situation is a little different since we can reproduce it by sending and receiving from the same Google Apps domain. Besides, I believe I have covered all of the proposed solutions for that question.

like image 789
Hank Avatar asked Jan 30 '11 00:01

Hank


2 Answers

I think you will need to use Domain Keys, read more about it here: http://en.wikipedia.org/wiki/DomainKeys

Google mail need this parameter, if you do not want to do it, you may need to use googlemail as smtp server.

I had this issue last month.

Another consideration are the urls, se this question: Gmail mark as spam email with html and anchor links

Hope it works.

like image 170
Rodrigo Ferrari Avatar answered Sep 27 '22 18:09

Rodrigo Ferrari


Other stuff that you can try:

  • Do not send your emails from an IP address which is known for sending spam. This usually means no shared hosting.
  • Make sure your mail host is a valid A record, rather than a CNAME.
  • Make sure your MX record is set to the full host name of your mail host (which is set-up as an A record).
  • Make sure you can do a reverse lookup of your mail host's IP address. This will be important for setting up SPF/Sender ID records.
  • Set up SPF/SenderID information as a TXT record.
  • Once you've configured everything you should verify it. Make sure there are no warnings or errors before contacting Gmail support.
  • Test your emails with Spam Assassin. Send yourself an email from your app and copy the raw message (including headers) to a text file and run it against Spam Assassin's command line test.
  • If you are sending plain text emails, make sure you have the charset in the Content-Type header set to ISO-8859-1. Gmail seems to be very particular about this.
like image 24
HTTP 410 Avatar answered Sep 27 '22 16:09

HTTP 410