//发送邮件通知
public void SendEmail(Guid CompanyID) {
//发件人邮箱
opa_company.ID = CompanyID;
opa_company = OPA_Company.GetEmailInfoByCID(opa_company);
string sendEmailAddress = opa_company.Email;
string sendEmailPassWord = opa_company.EmailPwd;
string SMTP = opa_company.SMTP;
//收件人邮箱
opa_company.ID = CompanyID;
opa_company=OPA_Company.GetEmailInfoByCID(opa_company);
string ResetEmailAddress = opa_company.Email;
Email email = new Email();
email.ID = opa_company.ID;
email.Name_Sender = "Admin";
email.Address_Sender = sendEmailAddress;
email.PassWord_Sender = sendEmailPassWord;
email.SMTP = SMTP;
email.Title = "续费通知";
email.Name_Receiver = opa_company.ContactMan;
email.Address_Receiver = opa_company.Email;
SmtpClient sc = new SmtpClient();
sc.EnableSsl = false;
sc.Host = email.SMTP;
sc.Port = 25;
sc.Credentials = new NetworkCredential(email.Address_Sender, email.PassWord_Sender);
MailMessage mm = new MailMessage();
mm.Priority = MailPriority.High;
mm.From = new MailAddress(email.Address_Sender, email.Name_Sender, Encoding.GetEncoding(936));
mm.To.Add(email.Address_Receiver);
mm.Subject = email.Title;
mm.SubjectEncoding = Encoding.GetEncoding(936);
mm.IsBodyHtml = true;
mm.BodyEncoding = Encoding.GetEncoding(936);
string Content = email.Name_Receiver + ",你好!<br/>贵公司的使用时间即将到期,请提前续费,以免延误工作。<br/>";
mm.Body = Content;
sc.Send(mm);
}