发邮件 System.Net.Mail.SmtpClient client = new SmtpClient("smtp.163.com"); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential("cwy_speed@163.com", "cwy_speed"); client.DeliveryMethod = SmtpDeliveryMethod.Network; MailAddress addressFrom = new MailAddress("a@a.com", "张三"); MailAddress addressTo = new MailAddress(strto, "李四"); System.Net.Mail.MailMessage message = new MailMessage(addressFrom, addressTo); message.Sender = new MailAddress("cwy_speed@163.com"); message.BodyEncoding = System.Text.Encoding.UTF8; message.IsBodyHtml = true; client.Send(message); 以上发邮件代码是百度来的,原发帖人名:CNET开发专家团 ,测试可用 |