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
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;
}
Alright this question is not same as this one : Sending mail through http proxy
That question specifically asks how to use proxy
My question on the other hand asks how to use http proxy to connect another mail server to send email
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
thank you