最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net C# 发送邮件实现代码
时间:2022-06-25 08:30:50 编辑:袖梨 来源:一聚教程网
asp教程.net c# 发送邮件实现代码
mailmessage mailmessage = new mailmessage();
mailmessage.to.add(this.txtto.text);
mailmessage.from = new system.net.mail.mailaddress(this.txtfrom.text);
mailmessage.subject = this.txttitle.text;
mailmessage.body = this.txtcontent.text;
mailmessage.isbodyhtml = true;
mailmessage.bodyencoding = system.text.encoding.utf8;
mailmessage.priority = system.net.mail.mailpriority.normal;smtpclient smtpclient = new smtpclient();
smtpclient.credentials = new system.net.networkcredential(mailmessage.from.address, this.txtpassword.text);
smtpclient.deliverymethod = system.net.mail.smtpdeliverymethod.network;
smtpclient.host = "smtp." + mailmessage.from.host;
smtpclient.port = 25;
smtpclient.timeout = 3000;
smtpclient.enablessl = false;
smtpclient.send(mailmessage);
this.txtto.text 发送给谁
this.txtfrom.text 来自谁
this.txttitle.text 邮件标题
this.txtcontent.text 邮件内容
this.txtpassword.text 发送者邮箱密码
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20