title: How to send mail in asp.net through proxy server
body: <p>i am trying to send mail through asp.net using the code mentioned below.
  it works fine without proxy environment. but now i am working with proxy servers and use proxy settings to connect to internet.
  it gives error 'Failure Sending Mail'
  Please anyone help ?</p>
  
  <pre><code>MailMessage msg = new MailMessage("xyz@gmail.com", TextBox1.Text);
  msg.Subject = TextBox2.Text;
  msg.Body = TextBox3.Text;
  SmtpClient s = new SmtpClient();
  s.Host = "smtp.gmail.com";
  s.EnableSsl = true;
  s.Credentials = new NetworkCredential("xyz@gmail.com", "password");
  s.Send(msg);
  </code></pre>