- MailMessage m = new MailMessage();
- m.From = new MailAddress("ir@w3mentor.com", "Raja Item");
- m.To.Add(new MailAddress("su@w3mentor.com", "Sekaran Uma"));
- m.Subject = "html email coming!";
- //Specify an HTML message body
- m.Body = "<html><body><h1>Welcome</h1><br>This is an HTML message for sharejs.com.</body></html>"
- m.IsBodyHtml = True
- // Send the message
- SmtpClient client = new SmtpClient("smtp.w3mentor.com");
- client.Send(m);
- //该片段来自于http://www.codesnippet.cn/detail/030920135575.html
来源: http://www.codesnippet.cn/detail/030920135575.html