这样试一试:把设置SMTP的那一句代码去掉,使用系统的默认设置,
解决方案 »
- 怪问题,VS2010在查看函数时候按下Shift+9就是打‘(’的时候VS2010就关闭了
- 代码 实现office 2010 转换pdf格式
- winform使用外部控件的问题
- winform中窗体的TransparencyKey这个属性怎么用
- 图片浏览问题
- 菜鸟问题,大家请时,关于DataGrid!
- 请教EventLog类为什么不能写,应该怎么设置才对
- 我想对.Net施行安乐死,它却说特效药可以救自己.后来,听说此处有天上雪莲,特来寻之...
- C# 调用 Session时出现了一下错误,只有一个页面会这样子
- WebRequest 返回服务器内部错误500
- c#紧急求助!!!
- Windows的datagrid控件可以在web页面中引用吗?
MailMessage mail = new MailMessage();
mail.To = "[email protected]";
mail.From = "[email protected]";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Attachments.Add (new MailAttachment("c:\\test.txt"));
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "tjq_tang"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "qqq"); //set your password here
SmtpMail.SmtpServer = "smtp.tom.com"; //your real server goes here
SmtpMail.Send( mail );
MessageBox.Show("发送成功");