高分求救:CDO发送邮件出错

xiaotouNo1 2003-10-09 06:00:49
在程序中我已经引用了CDO,
我的程序代码如下:
------------------------------------
try
{
CDO.Message oMsg = new CDO.Message();
oMsg.From = "zgr@zt.com.cn";
oMsg.To = "zgr@zt.com.cn";
oMsg.Subject = "发送试验";
oMsg.HTMLBody = "<html><body>恭喜发送成功!</body></html>";

CDO.IConfiguration iConfg = oMsg.Configuration;
ADODB.Fields oFields = iConfg.Fields;

oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value=2;
oFields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"].Value="zgr@zt.com.cn"; //sender mail
oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value="zgr@zt.com.cn"; //email account
oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value="zgr";
oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value="×××";
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value=1;
//value=0 代表Anonymous验证方式(不需要验证)
//value=1 代表Basic验证方式(使用basic (clear-text) authentication.
//The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
//Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value=0x0804;
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value="zgr-server";
oFields.Update();
oMsg.BodyPart.Charset="gb2312";
oMsg.HTMLBodyPart.Charset="gb2312";
oMsg.Send();
oMsg = null;
}
catch (Exception v)
{
throw v;
}
------------------------------------


报出的错误如下:
------------------------------------

“/eMail”应用程序中的服务器错误。
--------------------------------------------------------------------------------

邮件无法发送到 SMTP 服务器。传输错误代码为 0x800ccc15。服务器响应为 not available
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Runtime.InteropServices.COMException: 邮件无法发送到 SMTP 服务器。传输错误代码为 0x800ccc15。服务器响应为 not available
------------------------------------

各位高手请救急!!!
分数不够可以另开盘加分的。
...全文
118 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
greystar 2003-10-09
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1905/1905805.xml?temp=.3703577
xiaotouNo1 2003-10-09
  • 打赏
  • 举报
回复
up
xiaotouNo1 2003-10-09
  • 打赏
  • 举报
回复
up
xiaotouNo1 2003-10-09
  • 打赏
  • 举报
回复
老板是“无情”加“催命”,只要结果,不要过程的。
小弟已经连续加班一周了,结果卡在这了,
其实功能很简单,就是不知道哪个地方配置出了错………………唉,要命!

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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