日期:2014-05-16 浏览次数:20787 次
SmtpClient Sc = new SmtpClient("Smtp.163.com",465);
Sc.UseDefaultCredentials=false;
Sc.Credentials = new NetworkCredential("18662520263@163.com", "3+23+2");
Sc.DeliveryMethod = SmtpDeliveryMethod.Network;
MailMessage mm = new MailMessage();
mm.From=new MailAddress("18662520263@163.com");
mm.To.Add(new MailAddress("hwjxyd@163.com",null));
mm.Subject = "Test Maill";
mm.Body = "对于朝鲜来说,美日韩不仅是一个潜在的军事目标,而且也是一个阴险的道德威胁。";
mm.BodyEncoding = Encoding.UTF8;
mm.IsBodyHtml = true;
Sc.Send(mm);
Console.ReadKey();
try
{
MailMessage Message= new MailMessage();
MailAddress From = new MailAddress("18662520263@163.com");
MailAddress To = new MailAddress("hwjxyd@163.com", null);
Message.From = Fromma;
//收件人
Message.To.Add("hwjxyd@163.com");
//邮箱标题
Message.Subject = "Test Maill:";
Message.IsBodyHtml = true;
//邮件内容
Message.Body = "对于朝鲜来说,美日韩不仅是一个潜在的军事目标,而且也是一个阴险的道德威胁。";
//内容的编码格式
Message.BodyEncoding = System.Text.Encoding.UTF8;
Message.DeliveryNotificationOptions = DeliveryNotificationOptions.On