HOW TO avoid Spam Filters while emailing programmatically

Spam filters are generally built into email clients, can be installed seperately or implemented on the server. Many popular spam filters utilize Bayesian spam filtering besides other techniques to distinguish illegitimate spam email from legitimate email. 

The process involves training the spam filter to identify spam words. 
After training, the word probabilities (also known as likelihood functions) are used to compute the probability that an email with a particular set of words in it belongs to either category. Each word in the email contributes to the email's spam probability. This contribution is called the posterior probability and is computed using Bayes' theorem. Then, the email's spam probability is computed over all words in the email, and if the total exceeds a certain threshold (say 95%), the filter will mark the email as a spam.

To prevent a programmatically sent email from landing in the Junk folder, we have to understand how spam filters operate.

Using SpamAssassin (an open-source spam filter) as an example, Andreas points out that avoiding "spammy" text in the email, fewer images, a good well formed layout and having both HTML  and plain text views of the message can prevent an email from being marked as spam. His article includes a nice analysis of SpamAssassin & a C# code sample on creating an AlternateView that will please the spam filter.

Related: