title: Trying to send mail with c# Error: too many errors
body: <p>I am trying to send mail to approx. 2000 users. I am sure there is nothing wrong with credentails.</p>
  
  <p>This is my code:</p>
  
  <pre><code>SmtpClient client = new SmtpClient();
  client.EnableSsl = false;
  client.DeliveryMethod = SmtpDeliveryMethod.Network;
  client.Host = "---";
  client.Port = 587;
  client.UseDefaultCredentials = false;
  client.Credentials = new System.Net.NetworkCredential("---", "---");
  
  MailMessage msg = new MailMessage();
  msg.IsBodyHtml = true;
  msg.Body = "dfsdf";
  msg.BodyEncoding = System.Text.Encoding.UTF8;
  msg.Subject = "sdfsdf";
  msg.From = new MailAddress("---");
  
  msg.Bcc.Clear();
  MembershipUserCollection muc = Membership.GetAllUsers();
  foreach (MembershipUser mu in muc)
  {
      msg.Bcc.Add(mu.Email);
  }
  
  try
  {
      client.Send(msg);
  }
  catch (Exception ex)
  {
      Label_info.Text = ex.Message;
      if (ex.InnerException != null) Label_info.Text += "&lt;br /&gt;" + ex.InnerException.Message;
      return;
  }
  </code></pre>
  
  <p>This is the exception i get:
   Service not available, closing transmission channel. The server response was: 4.7.0 [my smtp name] Error: too many errors</p>