VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 编程开发 > C#编程 >
  • C#教程之适合小白的Demo_easyui+core3第三章通用类和方法

本站最新发布   C#从入门到精通
试听地址  
https://www.xin3721.com/eschool/CSharpxin3721/

1、发送邮件类,百度一大堆,这里用的也是直接百度拿过来的

public static bool get_send_email(email email, string Title, string Body) {
  MailMessage mailMsg = new MailMessage();
  mailMsg.From = new MailAddress(email.sendmail, email.sendname);
  mailMsg.To.Add(new MailAddress(email.acceptmail));
  mailMsg.Subject = Title;
  mailMsg.Body = Body;
  SmtpClient client = new SmtpClient();
  client.Host = "smtp.qq.com";
  client.Port = 587;
  client.EnableSsl = true;
  client.Credentials = new NetworkCredential(email.sendmail, email.token);
try {
  client.Send(mailMsg);
}
catch ( SmtpException ex ) {
return false;
}
return true;
}

添加引用web/h_r.sys引用service/h_r.base、service/data/h_r.efdata、common/h_r.common

不存在分层,只看做是一个demo即可。

相关教程