脚本宝典收集整理的这篇文章主要介绍了ASP.Net邮箱发邮件实例代码,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
//这里使用QQ的邮箱来发送测试,如果是其它邮箱,请根据其它邮箱pop3/IMAP/SMTP服务来设置
client.Host = "smtp.qq.COM";
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("6你的邮箱www.js-code.com", "***密码***");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("60**你的*www.js-code.com"541**收件人的www.js-code.com");
message.Subject = "主题";
message.Body = "内容";
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtML = true;
try
{
client.Send(message);
}
catch
{
}
}
以上是脚本宝典为你收集整理的ASP.Net邮箱发邮件实例代码全部内容,希望文章能够帮你解决ASP.Net邮箱发邮件实例代码所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。