title: Mail going to spam asp.net
body: <p>I am trying to send email with following code snippet.</p>
  
  <pre><code>        MailMessage mailMsg = new MailMessage();
          mailMsg.From = new MailAddress("cs@abc.com");
          mailMsg.Subject = "Test";
          mailMsg.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8");
  
  
          mailMsg.To.Add("abc.test@gmail.com");
  
  
  
          // Set the body of the mail message
          var BodyText = "&lt;html&gt;&lt;body&gt;Hi..&lt;/body&gt;&lt;/html&gt;";
  
  
          System.Net.Mail.AlternateView plainView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(System.Text.RegularExpressions.Regex.Replace(BodyText, @"&lt;(.|\n)*?&gt;", string.Empty), null, "text/plain");
          System.Net.Mail.AlternateView htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(BodyText, null, "text/html");
          mailMsg.AlternateViews.Add(plainView);
          mailMsg.AlternateViews.Add(htmlView);
  
          // Smtp configuration
          SmtpClient smtp = new SmtpClient();
          smtp.Host = "mail.shopmanza.com";
          smtp.Credentials = new NetworkCredential("cs@abc.com", "Cs@abc");
          smtp.Send(mailMsg);
  </code></pre>
  
  <p>My mail goes to spam folder instead of inbox. Any idea how to fix this?</p>