By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,365 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,365 IT Pros & Developers. It's quick & easy.

SMTP and MailMessage: My legit emails are maked as spam

P: 4
Hi All,

I am EXTREMELY desperate.

I have a website. (asp.net2 with c#)

User registers, their account is created in a locked state. They receive an email message to confirm that their email address is correct, they click on the link in the email, and their account is unlocked and ready to use.

EXCEPT: They never receive their email message, because it is seen as spam. So they sit there waiting for the message that doesn't arrive, and just end up leaving.

The message is sent by simply creating an instance of MailMessage, adding the to, from, subject and body fields, and then sent. Nothing fancy.

Among the reasons that I could find for my message being marked as spam are:

(From a friend's mail marshal log):

Very small body (15 points!),
Missing message-id,
"RH_GENR_HeaderSus146": (Header pattern common in Spam) (added 16 points)
"RH_GENR_HeaderSus653": (Header pattern common in Spam) (Added 24 points!!)
HeloOneW (1 point)
Missing X-Mailer: Field (2 points)

I have been trying to solve this for days, but any search on Google will return thousands of results on how to PREVENT spam, and not on how to prevent being marked as spam when it is not spam.

I am very desperate, and this is very urgent, as I am chasing away one in 5 clients, and my web site is getting really really bad exposure!

Anybody who has a quick and easy step-by-step solution will be my hero!!! (I am still fairly new to .net, and know even less about email protocols.)

Thx!!
Mar 13 '07 #1
Share this Question
Share on Google+
5 Replies


kenobewan
Expert 2.5K+
P: 4,871
Please provide an example email, excluding personal details. You may need to gain an understanding of how spam filters work...
Mar 13 '07 #2

P: 4
Thx for the reply!!

Here's an example of an email (with header info):

Delivered-To: louisjvd@gmail.com
Received: by 10.114.149.17 with SMTP id w17cs124151wad;
Tue, 13 Mar 2007 04:46:32 -0700 (PDT)
Received: by 10.66.221.6 with SMTP id t6mr1465725ugg.1173786392011;
Tue, 13 Mar 2007 04:46:32 -0700 (PDT)
Return-Path: <Mail@neverforgotten.co.za>
Received: from BEACH.home ([70.85.5.138])
by mx.google.com with ESMTP id k30si9509710ugc.2007.03.13.04.46.17;
Tue, 13 Mar 2007 04:46:32 -0700 (PDT)
Received-SPF: error (google.com: error in processing during lookup of Mail@neverforgotten.co.za: DNS timeout)
Received: from housepc ([41.241.219.172]) by home with MailEnable ESMTP; Tue, 13 Mar 2007 07:45:58 -0400
From: "NeverForgotten" <Mail@neverforgotten.co.za>
To: <louisjvd@gmail.com>
Subject: Mail Header from Outlook
Date: Tue, 13 Mar 2007 13:46:07 +0200
Message-ID: <CDEBKHLHNOBINNPLKDLEMEFBCAAA.Mail@neverforgotten. co.za>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on beach
X-Spam-Level:
X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham
version=2.64
Mar 13 '07 #3

P: 4
Oops!! Sorry!!

The email in the previous post is the wrong one. That one was sent from Outlook, and as far as I can see, they work if sent from outlook.

Here is an example of an email sent programmatically (that doesn't get deliverd)

Delivered-To: louisjvd@gmail.com
Received: by 10.114.149.17 with SMTP id w17cs124268wad;
Tue, 13 Mar 2007 04:47:49 -0700 (PDT)
Received: by 10.67.117.18 with SMTP id u18mr1125595ugm.1173786469244;
Tue, 13 Mar 2007 04:47:49 -0700 (PDT)
Return-Path: <Mail@neverforgotten.co.za>
Received: from BEACH.home ([70.85.5.138])
by mx.google.com with ESMTP id u1si9476675uge.2007.03.13.04.47.34;
Tue, 13 Mar 2007 04:47:49 -0700 (PDT)
Received-SPF: error (google.com: error in processing during lookup of Mail@neverforgotten.co.za: DNS timeout)
Message-Id: <45f68f5a.7ba24bf6.723c.0fe0SMTPIN_ADDED@mx.google .com>
Received: from housepc ([41.241.219.172]) by home with MailEnable ESMTP; Tue, 13 Mar 2007 07:47:15 -0400
mime-version: 1.0
from: Mail@neverforgotten.co.za
to: louisjvd@gmail.com
date: 13 Mar 2007 13:47:28 +0200
subject: Membership activation
content-type: text/plain; charset=us-ascii
content-transfer-encoding: quoted-printable
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on beach
X-Spam-Level:
X-Spam-Status: No, hits=-4.6 required=5.0 tests=BAYES_00,CLICK_BELOW,
NO_REAL_NAME autolearn=no version=2.64

Hi Person,=0D=0DThank you for registering on NeverForgotten. =0D=0DYou have=
received this email message because you applied for membership on the www.NeverForgotten.co.za=
website.=0D=0DTo activate your membership, simply click on the link below.=
You will automatically be logged in, and returned to the page you requested.=
=0D=0Dhttp://www.NeverForgotten.co.za/ActivateAccount.aspx?Uid=3D46f4f9d1-bbd0-4cca-8f67-055a0792e64d=
=0D=0DIf you believe that you have received this email in error, please=
contact us at mail@NeverForgotten.co.za, and let us know about this mistake=
so that we can attempt to rectify the problem.=0D=0DThank you=0D=0DNeverForgotten
Mar 13 '07 #4

kenobewan
Expert 2.5K+
P: 4,871
Please post your code that you use to send email. I hope that the email wasn't a red herring. Thanks.
Mar 14 '07 #5

P: 4
Hi,

I don't know what a red herring is, but I also hope it isn't one :)

This is the code that was used to send the message. The first half of the code is just building the email body, so don't worry too much about that...


Expand|Select|Wrap|Line Numbers
  1.         string MailServerName = "mail.neverforgotten.co.za";
  2.         //MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);
  3.         Guid userId = Guid.NewGuid();
  4.  
  5.         string sString = "Hi " + "Person" + ",\r\rThank you for registering on NeverForgotten. \r\rYou have received this email message because you applied for membership on the www.NeverForgotten.co.za website."
  6.             + "\r\rTo activate your membership, simply click on the link below. "
  7.             + "You will automatically be logged in, and returned to the page you requested.\r\r"
  8.             + "http://www.NeverForgotten.co.za/ActivateAccount.aspx?Uid=" + userId.ToString();
  9.  
  10.         if (!(Request.QueryString["ReturnUrl"] == null || Request.QueryString["ReturnUrl"] == ""))
  11.         {
  12.             //string tmpstr=Request.QueryString["ReturnUrl"].Replace("?", "&")
  13.             sString += "&ReturnURL=" + Request.QueryString["ReturnUrl"];
  14.         }
  15.         if (Session["PersonID"] != null)
  16.         {
  17.             //Get the key for the current person
  18.             DataSet1TableAdapters.KeysTableAdapter ta = new DataSet1TableAdapters.KeysTableAdapter();
  19.             DataSet1.KeysDataTable dt = ta.GetKeyForPerson(Convert.ToInt32(Session["PersonID"]));
  20.             sString += "&Key=" + dt[0].KeyID;
  21.         }
  22.  
  23.         sString += "\r\rIf you believe that you have received this email in error, please contact us at mail@NeverForgotten.co.za, and let us know about this mistake so that we can attempt to rectify the problem."
  24.             + "\r\rThank you\r\rNeverForgotten";
  25.  
  26.         //Label1.Text = sString;
  27.  
  28.         string sSubj = "Membership activation";
  29.         //string sSubj = "TEST";
  30.         MailMessage msg = new MailMessage(); //("Mail@neverforgotten.co.za", TextBox1.Text, sSubj, sString);
  31.         msg.From = new MailAddress("Mail@NeverForgotten.co.za", "NeverForgotten");
  32.         msg.To.Add(new MailAddress(TextBox1.Text));
  33.         msg.Subject = sSubj;
  34.         msg.Body = sString;
  35.  
  36.         SmtpClient MailClient = new SmtpClient(MailServerName);
  37.  
  38.         MailClient.Send(msg);
  39.         msg.Dispose();
  40.  
Mar 14 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.