private void SendMail()
{
System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage();
//設置發件人地址
mailMessage.From = new System.Net.Mail.MailAddress("
[email protected]");
//添加收件人地址
mailMessage.To.Add("
[email protected]");
mailMessage.To.Add("
[email protected]");
mailMessage.To.Add("
[email protected]");
//郵件主題
mailMessage.Subject = "郵件主題";
//郵件正文
mailMessage.Body = "郵件正文";
//正文編碼方式
mailMessage.BodyEncoding = System.Text.Encoding.UTF8;
//郵件正文是否為Html的值
mailMessage.IsBodyHtml = true;
//設置郵件發送的優先級
mailMessage.Priority = System.Net.Mail.MailPriority.Normal;
System.Net.Mail.SmtpClIEnt mail = new System.Net.Mail.SmtpClIEnt();
//設置SMTP主機地址