每个人都有自己的知识体系。
Toggle navigation
Home
随笔
C#/.Net
树莓派 / Raspberry
皓月汉化组
Beego
Golang
OxideMod
apache
haproxy
windows
Java
Objective-C
日语/罗马音歌词/日语常识
MongoDB
python
电学
公告
Minecraft服务器-公告
NanoPi
C4D (CINEMA 4D)
生活
推流/m3u8/rtmp/rtsp
Unity3d
ffmpeg
数据结构
区块链
tarui
UnityForPSVita
About Me
Archives
Tags
邮件发送(拷贝)
2018-01-08 16:02:28
114
0
0
akiragatsu
private void btn_send_Click(object sender, EventArgs e) { var emailAcount = ConfigurationManager.AppSettings["EmailAcount"]; var emailPassword = ConfigurationManager.AppSettings["EmailPassword"]; var reciver = txt_Reciver.Text; var content = rtxt_Content.Text; MailMessage message = new MailMessage(); //设置发件人,发件人需要与设置的邮件发送服务器的邮箱一致 MailAddress fromAddr = new MailAddress("qwe123@qq.com"); message.From = fromAddr; //设置收件人,可添加多个,添加方法与下面的一样 message.To.Add(reciver); //设置抄送人 message.CC.Add("qwe123@163.com"); //设置邮件标题 message.Subject = "Test"; //设置邮件内容 message.Body = content; //设置邮件发送服务器,服务器根据你使用的邮箱而不同,可以到相应的 邮箱管理后台查看,下面是QQ的 SmtpClient client = new SmtpClient("smtp.qq.com", 25); //设置发送人的邮箱账号和密码 client.Credentials = new NetworkCredential(emailAcount,emailPassword); //启用ssl,也就是安全发送 client.EnableSsl = true; //发送邮件 client.Send(message); }
Pre:
Next:
皓月Minecraft服务器优化维护日志
0
likes
114
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.