日期:2014-05-17 浏览次数:20355 次
SmtpClient client = new SmtpClient("xxx.com");
client.UseDefaultCredentials = true;
//这里的用户不是Email形式的,想不通是不是这里的问题啊?
client.Credentials = new NetworkCredential("ABCEFEG", "25wdksoeng");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.From = new MailAddress("aa@aa.aa", strFrom);
message.To.Add(strto);
message.Subject = strSubject;
message.Body = strBody;
message.BodyEncoding = System.Text.Encoding.GetEncoding("gb2312");
message.SubjectEncoding = System.Text.Encoding.GetEncoding("gb2312");
message.IsBodyHtml = true;
message.Priority = System.Net.Mail.MailPriority.High;
client.Send(message);
SmtpClient client = new SmtpClient("smtp.qq.com");
client.UseDefaultCredentials = true;
client.Credentials = new NetworkCredential("44@qq.com", "11");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.From = new MailAddress("44@qq.com", strFrom);
message.To.Add(strto);
message.Subject = strSubject;
message.Body = strBody;
message.BodyEncoding = System.Text.Encoding.GetEncoding("gb2312");
message.SubjectEncoding = System.Text.Enco