private System.Web.Mail.MailMessage m_Mail;m_Mail=new MailMessage(); m_Mail.From="[email protected]";m_Mail.To="[email protected]";
m_Mail.Subject="test";m_Mail.BodyFormat=MailFormat.Html;m_Mail.Body="hello!!!";
SmtpMail.SmtpServer="srvcn015.weidmueller.com";   SmtpMail.Send(m_Mail);错误信息是:
The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available Source Error: 
Line 80:  SmtpMail.SmtpServer="srvcn015.weidmueller.com";   
Line 81: 
Line 82:  SmtpMail.Send(m_Mail);
Line 83: 
Line 84:  //Label3.Text="发送成功";
 Source File: c:\inetpub\wwwroot\webapplication1\webform3.aspx.cs    Line: 82 Stack Trace: 
[COMException (0x80040211): The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available
][TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
   System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
   System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
   System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args)
   System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)[HttpException (0x80004005): Could not access 'CDO.Message' object.]
   System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args)
   System.Web.Mail.CdoSysHelper.Send(MailMessage message)
   System.Web.Mail.SmtpMail.Send(MailMessage message)
   WebApplication1.WebForm3.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication1\webform3.aspx.cs:82
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain() 
请问是什么问题啊?

解决方案 »

  1.   

    你的邮件服务器不能用SmtpMail.SmtpServer="srvcn015.weidmueller.com";  
      

  2.   

    SmtpMail 怀疑没有安装好.
    或者使用jmail组件测试一下
      

  3.   

    已经装了。如果SmtpMail.SmtpServer="localhost"; 那么测试就可以成功了。在:\Inetpub\mailroot\Queue 下面就可以看到我发的邮件。问题是我要发到我们公司的邮件服务器上去。公司的人才能看到我发的邮件啊。
      

  4.   

    SmtpMail.SmtpServer="srvcn015.weidmueller.com";  请问你的邮件是不是通过网络上的服务器转发的啊!看你的smtp服务器地址对不!像163的是smtp.163.com
    还有就是授权,用户名密码..你网上搜一下,有示例如果是本地iis中,我没用过!
      

  5.   

    我们公司用的是exchange server,这个支持smtp吗?
      

  6.   

    如果是你們公司的那就填你們公司的郵件server
    然后用你自己的帳號密碼
      

  7.   

    验证没有通过,是.net 2.0用下面的代码发即可.(System.Net.Mail命名空间的) 
    SmtpClient smtp = new SmtpClient("srvcn015.weidmueller.com");
                    smtp.Credentials = new System.Net.NetworkCredential(发件邮箱的用户名, 密码);
                    MailMessage mes = new MailMessage();                mes.From = new MailAddress("[email protected]");
                    mes.To.Add("要发给谁");                mes.Subject = "主题";
                    mes.Body = "hello!";
                    mes.IsBodyHtml = true;                smtp.Send(mes);
      

  8.   

    SmtpMail,这个东西需要你本地有Smtp服务器的,你本地没有这个Smtp服务器所以没有用的!
    介绍给你一个Jmail的吧,http://blog.csdn.net/zhouxing_24/archive/2008/12/30/3650579.aspx
    关于这个JMAIL类你可以到网络上下载!
      

  9.   

    还是不行,错误信息如下:[COMException (0x8000ffff): The message was undeliverable. All servers failed to receive the message]
       jmail.MessageClass.Send(String mailServer, Boolean enque) +0
       WebApplication1.WebForm3.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication1\webform3.aspx.cs:69
       System.Web.UI.WebControls.Button.OnClick(EventArgs e)
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       System.Web.UI.Page.ProcessRequestMain()