最新下载
热门教程
- 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 发送者邮箱密码
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21