我是否需要头文件才能通过C#.net发送html邮件?

时间:2011-05-09 06:56:27

标签: c# system.web.mail

我有以下代码:

using System.Web.Mail;

MailMessage myMail = new MailMessage();
myMail.From = "anitha.anba@gmail.com";
myMail.To = "ani2devi@yahoo.co.in";
myMail.Body = "<html><body>success</body></html>";
myMail.Subject = "checkmail";
SmtpMail.SmtpServer = "mymailserver";
SmtpMail.Send(myMail);

SmtpMail中显示错误。是否需要任何头文件?如果是这样,有人可以列出他们吗?

0 个答案:

没有答案