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()
请问是什么问题啊?
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()
请问是什么问题啊?
或者使用jmail组件测试一下
还有就是授权,用户名密码..你网上搜一下,有示例如果是本地iis中,我没用过!
然后用你自己的帳號密碼
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);
介绍给你一个Jmail的吧,http://blog.csdn.net/zhouxing_24/archive/2008/12/30/3650579.aspx
关于这个JMAIL类你可以到网络上下载!
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()