title: How to use http proxy while sending email via SmtpClient
body: <p>I am able to send emails via below way with Yahoo emails. But my question is can i also make it a way that computer will use proxy while connecting yahoo servers ? I mean use proxy connection to connect yahoo smpt server. Is this possible ? thank you</p>
  
  <pre><code>public static bool func_SendEmail(string srFrom, string srSenderEmail, string srSenderEmailPw, 
          string srHtmlBody, string srTextBody, string srTitle, string srProxy)
  {
      try
      {
          using (MailMessage message = new MailMessage(new MailAddress(srSenderEmail, srFrom), new MailAddress(srSenderEmail)))
          {
              message.ReplyTo = new MailAddress(srSenderEmail, srFrom);
              message.IsBodyHtml = false;
              message.Subject = srTitle;
              message.SubjectEncoding = System.Text.Encoding.UTF8;
              AlternateView textPart = AlternateView.CreateAlternateViewFromString(srTextBody, Encoding.UTF8, "text/plain");
              textPart.TransferEncoding = System.Net.Mime.TransferEncoding.QuotedPrintable;
              message.AlternateViews.Add(textPart);
              AlternateView htmlPart = AlternateView.CreateAlternateViewFromString(srHtmlBody, Encoding.UTF8, "text/html");
              htmlPart.TransferEncoding = System.Net.Mime.TransferEncoding.QuotedPrintable;
              message.AlternateViews.Add(htmlPart);
              message.BodyEncoding = Encoding.UTF8;
              using (SmtpClient oSmtp = new SmtpClient())
              {
                  oSmtp.Host = "smtp.mail.yahoo.com";
                  oSmtp.Credentials = new NetworkCredential(srSenderEmail, srSenderEmailPw);
                  oSmtp.EnableSsl = false;
                  oSmtp.Port = 587;
                  oSmtp.Send(message);
              }
          }
      }
      catch
      {
          return false;
      }
      return true;
  }
  </code></pre>
  
  <p>Alright this question is not same as this one : <a href="https://stackoverflow.com/questions/844835/sending-mail-throught-http-proxy">Sending mail through http proxy</a></p>
  
  <p>That question specifically asks how to use proxy</p>
  
  <p>My question on the other hand asks how to use http proxy to connect another mail server to send email</p>
  
  <p>In this case i want to use threads, proxies for each thread and from this each thread connect to yahoo smtp server with using http proxy to send email</p>
  
  <p>thank you</p>