title: Email messages going to spam folder
body: <p>I have created a community portal, in which user creates his/her account. After successfull registration a confirmation mail is send on registered email address. </p>
  
  <p>I am using the following code to send the mail -</p>
  
  <pre><code>private void SendMail(string recvr, string recvrName, string verCode, int NewUserID)
  {
      try
      {
          string emailID = ConfigurationManager.AppSettings["WebMasterMail"];
          string mailPass = ConfigurationManager.AppSettings["pass"];
          string mailer = ConfigurationManager.AppSettings["mailer"];
  
          MailMessage msg = new MailMessage();
          MailAddress addrFrom = new MailAddress(emailID, "Panbeli.in.... Bari community portal");
          MailAddress addrTo = new MailAddress(recvr, recvrName);
  
          msg.To.Add(addrTo);
          msg.From = addrFrom;
          msg.Subject = "You have registered sucessfully on PanBeli.in.";
          msg.Priority = MailPriority.High;
          msg.Body = RegisterMessageBody(recvrName, verCode,NewUserID);
          msg.IsBodyHtml = true;
  
          SmtpClient smtp = new SmtpClient(mailer);
          smtp.Credentials = new System.Net.NetworkCredential(emailID, mailPass);
          smtp.Send(msg);
      }
      catch (Exception Ex) { }
  }
  </code></pre>
  
  <p>While testing we found that all the confirmation mails are going to SPAM folder instead of Inbox.</p>
  
  <p>Is there anything wrong with the code or is there anything related to security.</p>
  
  <p>Can anybody suggest solution to this problem.</p>
  
  <p>Thanks for sharing your time.</p>