码迷,mamicode.com
首页 > 其他好文 > 详细

email

时间:2017-08-22 10:38:04      阅读:171      评论:0      收藏:0      [点我收藏+]

标签: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);
        }    

  

 

email

标签:highlight   string   mail   dem   address   blog   ***   content   net   

原文地址:http://www.cnblogs.com/panpanwelcome/p/7410217.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!