title: How can I send email through proxy server in C#
body: <p>Hi I want to send mail with ASP.NET, 
  but I want to send email through proxy server,
  So how should I edit the code below to send it through a proxy server?</p>
  
  <p>Thanks</p>
  
  <pre><code>MailMessage mail = new MailMessage();
  SmtpClient SmtpServer = new  SmtpClient(ConfigurationManager.AppSettings["MailServer"]);
  mail.From = new MailAddress(ConfigurationManager.AppSettings["MailAccount"]);
  mail.To.Add(toAddres);
  mail.CC.Add(new MailAddress(ccAddress));
  mail.Subject = subject;
  mail.Body = content;
  mail.IsBodyHtml = true;
  SmtpServer.Port = ConfigurationManager.AppSettings["MailPort"] == null ? 587 : int.Parse(ConfigurationManager.AppSettings["MailPort"]);
  SmtpServer.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["MailUserName"], ConfigurationManager.AppSettings["MailPassword"]);
  SmtpServer.EnableSsl = false;
  SmtpServer.Send(mail);
  </code></pre>