title: The SMTP server requires a secure connection when i try to send an email
body: <p>Hi guys I create a mail class to send emails.</p>
  
  <pre><code>public void SendEmail(string subject, string messageBody, string toAddress)
  {
      MailMessage mail = new MailMessage();
      mail.To.Add(toAddress);
      //mail.To.Add("amit_jain_online@yahoo.com");
      mail.From = new MailAddress("noreply3ncra@gmail.com");
      mail.Subject = subject;
      string Body = messageBody;
      mail.Body = Body;
      mail.IsBodyHtml = true;
      SmtpClient smtp = new SmtpClient();
      smtp.UseDefaultCredentials = false;
  
      smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
      smtp.Credentials = new System.Net.NetworkCredential
           ("noreply3ncra@gmail.com", "********");
      //Or your Smtp Email ID and Password
      smtp.EnableSsl = true;
      smtp.Send(mail);
  }
  </code></pre>
  
  <p>But I got this error:</p>
  
  <blockquote>
    <p>The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.</p>
  </blockquote>
  
  <p>So I have to sign into <strong>Gmail</strong> and enter the <strong>captcha</strong> code and after this every thing is going to be ok.</p>
  
  <p>What should I do?</p>