高分求救:CDO发送邮件出错
在程序中我已经引用了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
------------------------------------
各位高手请救急!!!
分数不够可以另开盘加分的。