I am sending a new logon and password to a user, however when I do on a test version of our site on the internet the Spam score is 4.6 by spam assassin. Which means it gets trapped.
The Email is HTML (so the marketing dept have their nice fonts and colours) with a linked image.
The MailMessage() object does not appear to give me a lot of control over the output format of the message.
What measures could I take to lower the spam score?
I am sending using this:
/* send an email */
MailMessage msg = new MailMessage();
msg.IsBodyHtml = true;
//msg.BodyEncoding = Encoding.UTF8;
msg.To.Add(new MailAddress(sToEmail));
msg.From = new MailAddress(sFromEmail);
msg.Subject = sEmailSubject;
msg.Body = sEmailTemplate;
try
{
client.Send(msg);
}
The spam score is this:
X-Spam-Score: 4.6 (++++)
X-Spam-Report: Spam detection software report (4.6 points):
pts rule name description
---- ---------------------- --------------------------------------------------
1.8 HTML_IMAGE_ONLY_20 BODY: HTML: images with 1600-2000 bytes of words
0.0 HTML_MESSAGE BODY: HTML included in message
1.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
1.1 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag
0.1 RDNS_NONE Delivered to trusted network by a host with no rDNS
Using the AlternateView class, you can specify a text/plain body and provide an alternate html body for the marketing boys. Even if the text part only says that you should have an html enable reader, the spam filter will drop 1.8 points.
Then if you start the HTML message with a proper tag (just take a full html page), you will drop 2.8 poins.
You can also include LinkedResources so you can send the image without showing attachments, much nicer.