mail.Fields.Add报错 不是System.Web.Mail.MailMessage成员

ssun1999 2004-12-15 03:08:46

private void Page_Load(object sender, System.EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "my_username_here"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "super_secret"); //set your password here

SmtpMail.SmtpServer = "mail.mycompany.com"; //your real server goes here
SmtpMail.Send( mail );
}

...全文
56 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
simon8181 2005-02-23
  • 打赏
  • 举报
回复
关闭防火墙
trueboy 2005-02-23
  • 打赏
  • 举报
回复
还用说?

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧