1个回答
展开全部
.Net 2.0的 using System.Net.Mail; public void SendSMTPEMail(string strSmtpServer, string strFrom, string strFromPass, string strto, string strSubject, string strBody) { System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential(strFrom, strFromPass); client.DeliveryMethod = SmtpDeliveryMethod.Network; System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(strFrom, strto, strSubject, strBody); System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment("卜乎c:\\log.log"); message.Attachments.Add(attachment); message.BodyEncoding = System.Text.Encoding.UTF8; message.IsBodyHtml = true; client.Send(message); } 自丛弊亮渗宽己看看吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询