Dim sendto, logname, logpwd As String
sendto = "[email protected]"
logname = "logname"
logpwd = "123456"
Dim aMsg As New System.Web.Mail.MailMessage
aMsg.From = "[email protected]"
aMsg.To = sendto
aMsg.Subject = "找回的密码"
aMsg.Body = "你好,你的**操作员帐号是:" & logname & ",密码是:" & logpwd & "请你牢记!"Dim SmtpMail As System.Web.Mail.SmtpMail
SmtpMail.SmtpServer = "smtp.192.168.1.99"
SmtpMail.Send(aMsg)全部代码如上,是这样写吗,IIS里还要怎么设置吗?运行后错误提示如下:异常详细信息: System.Runtime.InteropServices.COMException: The transport failed to connect to the server. 源错误: 行 118: Dim SmtpMail As System.Web.Mail.SmtpMail
行 119: SmtpMail.SmtpServer = "smtp.192.168.1.99"
行 120: SmtpMail.Send(aMsg)
行 121:
行 122:
源文件: E:\ww\hd\huiyuan\find.aspx.vb 行: 120 堆栈跟踪: [COMException (0x80040213): The transport failed to connect to the server.
][TargetInvocationException: 调用的目标发生了异常。]
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.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58[HttpException (0x80004005): 未能访问“CDO.Message”对象。]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +112
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
hd.find.Button1_Click(Object sender, EventArgs e) in E:\ww\hd\huiyuan\find.aspx.vb:120
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
sendto = "[email protected]"
logname = "logname"
logpwd = "123456"
Dim aMsg As New System.Web.Mail.MailMessage
aMsg.From = "[email protected]"
aMsg.To = sendto
aMsg.Subject = "找回的密码"
aMsg.Body = "你好,你的**操作员帐号是:" & logname & ",密码是:" & logpwd & "请你牢记!"Dim SmtpMail As System.Web.Mail.SmtpMail
SmtpMail.SmtpServer = "smtp.192.168.1.99"
SmtpMail.Send(aMsg)全部代码如上,是这样写吗,IIS里还要怎么设置吗?运行后错误提示如下:异常详细信息: System.Runtime.InteropServices.COMException: The transport failed to connect to the server. 源错误: 行 118: Dim SmtpMail As System.Web.Mail.SmtpMail
行 119: SmtpMail.SmtpServer = "smtp.192.168.1.99"
行 120: SmtpMail.Send(aMsg)
行 121:
行 122:
源文件: E:\ww\hd\huiyuan\find.aspx.vb 行: 120 堆栈跟踪: [COMException (0x80040213): The transport failed to connect to the server.
][TargetInvocationException: 调用的目标发生了异常。]
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.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58[HttpException (0x80004005): 未能访问“CDO.Message”对象。]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +112
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
hd.find.Button1_Click(Object sender, EventArgs e) in E:\ww\hd\huiyuan\find.aspx.vb:120
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
行 119: SmtpMail.SmtpServer = "localhost"
行 120: SmtpMail.Send(aMsg)
行 121:
行 122:
源文件: E:\ww\hd\huiyuan\find.aspx.vb 行: 120 堆栈跟踪: [COMException (0x8004020f): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for [email protected]
][TargetInvocationException: 调用的目标发生了异常。]
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.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58[HttpException (0x80004005): 未能访问“CDO.Message”对象。]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +112
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
hd.find.Button1_Click(Object sender, EventArgs e) in E:\ww\hd\huiyuan\find.aspx.vb:120
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
为什么还有错误啊,可以再帮我看看,谢谢啊!!!!!!!!!!!!!!
sendto = "[email protected]"
logname = "logname"
logpwd = "123456"
Dim aMsg As New System.Web.Mail.MailMessage
aMsg.From = "[email protected]"
aMsg.To = sendto
aMsg.Subject = "找回的密码"
aMsg.Body = "你好,你的**操作员帐号是:" & logname & ",密码是:" & logpwd & "请你牢记!"Dim SmtpMail As System.Web.Mail.SmtpMail
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(aMsg)
全部代码如上,帮我看看有没有写完整啊?????
测试时上面每一条语都执行了啊,
可是打开邮箱却没有任何新邮件啊,为什么会这样??????????????
sendto = "[email protected]"
logname = "logname"
logpwd = "123456"
Dim aMsg As New System.Web.Mail.MailMessage
aMsg.From = "[email protected]"
aMsg.To = sendto
aMsg.Subject = "找回的密码"
aMsg.Body = "你好,你的**操作员帐号是:" & logname & ",密码是:" & logpwd & "请你牢记!"Dim SmtpMail As System.Web.Mail.SmtpMail
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(aMsg)
全部代码如上,高手帮我看看有没有写完整啊?????
测试时上面每一条语都执行了啊,
可是打开邮箱却没有任何新邮件啊,为什么会这样??????????????
aMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","YourEmail");
aMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","YourPassword");加上试试看。
下载:http://www.aspxcontrol.com
使用我的控件则不会有此问题,我控件是免费的,WIN和WEB都可以用。下载是:
http://www.aspxcontrol.com