We added our company logo to outgoing emails and then noticed that our emails weren't going out from nopCommerce and we received something like the following in the System Log:
Error sending e-mail. Mailbox unavailable. The server response was: Your message was marked as spam and scored 5.3 points with a required score
Our hosting vendor pointed us to the following article:
http://www.andreas-kraus.net/blog/tips-for-avoiding-spam-filters-with-systemnetmail/
Based on that, I changed the Nop.BusinessLogic.MessageManager class' SendEmail function as follows:
1. Comment out "message.Body = Body;"
2. Comment out "message.IsBodyHtml = true;"
3. Below that line, insert the following:
message.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8");
if (!Body.StartsWith("<html>", true, CultureInfo.CurrentCulture))
{
Body = "<html><body>" + Body + "</body></html>";
}
AlternateView plainView = AlternateView.CreateAlternateViewFromString(
System.Text.RegularExpressions.Regex.Replace(Body, @"<(.|\n)*?>", string.Empty), null, "text/plain");
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Body, null, "text/html");
message.AlternateViews.Add(plainView);
message.AlternateViews.Add(htmlView);
After doing this, all our our emails go out.
We help this helps someone else out.
Thanks,
Ben