title: Can't send mail using SmtpClient
body: <p>I want to send mail using SmtpClient class, but it not work.
  Code:</p>
  
  <pre><code>SmtpClient smtpClient = new SmtpClient();
  
  smtpClient.UseDefaultCredentials = false;
  smtpClient.Credentials = new System.Net.NetworkCredential(obMailSetting.UserName, obMailSetting.Password);
  
  smtpClient.Host = obMailSetting.HostMail;
  smtpClient.Port = obMailSetting.Port;
  smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
  smtpClient.EnableSsl = obMailSetting.Connect_Security;//true
  //smtpClient.UseDefaultCredentials = true;//It would work if i uncomment this line
  smtpClient.Send(email);
  </code></pre>
  
  <p>It throws an exception:</p>
  
  <blockquote>
    <p>The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated</p>
  </blockquote>
  
  <p>I'm sure that username and password is correct. Is there any problem in my code?
  Thanks.</p>