发送邮件时为何会出现“邮件无法发送到 SMTP 服务器。传输错误代码为 0x800ccc15。服务器响应为 not available ”

ristona 2004-03-23 03:03:04
我用的是SMTPMAIL类
...全文
193 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
tjq_tang 2004-03-23
  • 打赏
  • 举报
回复
//不知道这个能不能对你有所帮助
MailMessage mail = new MailMessage();
mail.To = "tjq_tang@hotmail.com";
mail.From = "tjq_tang@tom.com";
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("发送成功");
starheart 2004-03-23
  • 打赏
  • 举报
回复
这样试一试:把设置SMTP的那一句代码去掉,使用系统的默认设置,

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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