適合小白的Demo_easyui+core3第三章通用類和方法

一、發送郵件類,百度一大堆,這裏用的也是直接百度拿過來的web

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;
}token

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

不存在分層,只看作是一個demo便可。string

相關文章
相關標籤/搜索