通过HTTP代理服务器发送邮件 [英] Sending mail through http proxy
本文介绍了通过HTTP代理服务器发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从通过在Internet选项设置HTTP代理服务器连接到互联网的系统发送电子邮件。
I'm trying to send emails from a system that connects to internet through a http proxy which is set in Internet Options.
我使用SmtpClient。
i'm using SmtpClient.
有没有办法通过这个代理服务器设置与SmtpClient发送邮件。
谢谢
Is there any way to send mails with SmtpClient through this proxy setting. Thanks
推荐答案
据我所知,您要使用浏览器默认设置,我也想一个答案。
I understand that you want to use the browsers default settings, i would also like an answer for that.
同时,你可以做手工。
MailAddress from = new MailAddress("from@mailserver.com");
MailAddress to = new MailAddress("to@mailserver.com");
MailMessage mm = new MailMessage(from, to);
mm.Subject = "Subject"
mm.Body = "Body";
SmtpClient client = new SmtpClient("proxy.mailserver.com", 8080);
client.Credentials = new System.Net.NetworkCredential("from@mailserver.com", "password");
client.Send(mm);
这篇关于通过HTTP代理服务器发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文