c#465端口发送邮件

发布日期:2018-02-08    浏览次数:592
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = "收件箱";
mail.From = "发件箱";
mail.Subject = "邮件标题";
mail.BodyFormat = System.Web.Mail.MailFormat.Html;
mail.Body = "邮件内容";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "发件箱");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "发件箱密码");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 465);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
System.Web.Mail.SmtpMail.SmtpServer = "smtp.exmail.qq.com";//邮件服务器
System.Web.Mail.SmtpMail.Send(mail);

本文网址:https://www.wyxxw.cn/blog-detail-2-6-95.html

返回列表

非特殊说明,本文版权归原作者所有,转载请注明出处

提示:本站所有资源仅供学习与参考,请勿用于商业用途。图片来自互联网~如侵犯您的权益,请联系QQ:1067507709.

提示:转载请注明来自:https://www.wyxxw.cn/blog-detail-2-6-95.html 。 本文发布者:momo