标签:highlight string mail dem address blog *** content net
163邮件发送
private void SendEmail(string content) { SmtpClient mSmtpClient = new SmtpClient(); mSmtpClient.Host = "smtp.163.com"; mSmtpClient.Port = 25; mSmtpClient.UseDefaultCredentials = true; mSmtpClient.EnableSsl =false; var mSenderUsername = "abc"; var mSenderPassword = "*****";//授权码 mSmtpClient.Credentials = new System.Net.NetworkCredential(mSenderUsername, mSenderPassword); mSmtpClient.DeliveryMethod =SmtpDeliveryMethod.Network; MailMessage mMailMessage = new MailMessage(); mMailMessage.To.Add("abc@163.com"); mMailMessage.From = new MailAddress(mailFromAddress); mMailMessage.Subject = "可疑关键词"; mMailMessage.Body = content; mMailMessage.IsBodyHtml = true; mMailMessage.BodyEncoding = System.Text.Encoding.UTF8; mMailMessage.Priority = MailPriority.Normal; mSmtpClient.Send(mMailMessage); }
标签:highlight string mail dem address blog *** content net
原文地址:http://www.cnblogs.com/panpanwelcome/p/7410217.html