title: Asp.net Failure sending mail after enabling TLS1.2
body: <p>I have windows dedicated server hosting more than 20 websites all built using asp.net.
  All my sites were sending emails using Gmail SMTP perfectly, but 2 days ago I asked tech-support to enable TLS1.2 and disable TLS1.0; when this happened all the emails stopped!</p>
  
  <p>I have tried all solutions <a href="https://stackoverflow.com/questions/20906077/gmail-error-the-smtp-server-requires-a-secure-connection-or-the-client-was-not">Here</a>  but still no use!
  Finally, I tried to use another email provider instead of Gmail and the emails are sent successfully.</p>
  
  <p>Does anybody know what happens to Gmail services with TLS1.2?</p>
  
  <p>Here is code sample:</p>
  
  <pre><code> public static bool SendMail(MailAddressCollection TO_List, string Subject, string Body, bool Is_Html_Body, System.Collections.Hashtable Attachments)
      {
  
          MailMessage msg = new MailMessage();
          msg.Subject = Subject;
          msg.Body = Body;
          msg.BodyEncoding = System.Text.Encoding.UTF8;
          msg.IsBodyHtml = Is_Html_Body;
          msg.Priority = MailPriority.High;
          SmtpClient sc = new SmtpClient();
          if (Attachments != null)
          {
              foreach (Attachment AttachmentObj in Attachments.Values)
              {
                  msg.Attachments.Add(AttachmentObj);
              }
          }
          foreach (MailAddress To_Address in TO_List)
          {
              msg.To.Add(To_Address);
          }
          sc.Send(msg);
          return true;
      }
  </code></pre>
  
  <p>And this is web.config data:</p>
  
  <pre><code>&lt;smtp from="myemail@gmail.com"&gt;
      &lt;network defaultCredentials="false" host="smtp.gmail.com" password="Pass here" userName="myemail@gmail.com" enableSsl="true" port="587" /&gt;
    &lt;/smtp&gt;
  </code></pre>