asp-classic – asp CDO.Message.1错误’80040213’传输无法连接
发布时间:2020-12-16 06:58:05 所属栏目:asp.Net 来源:网络整理
导读:CDO.Message.1 error '80040213'The transport failed to connect to the server./check.asp,line 25 请帮忙解决这个问题 检查此代码 %@ Language=VBScript %htmlhead/headbody%dim to_field,messageto_field = Request.Form("to_field")message = Request.F
CDO.Message.1 error '80040213' The transport failed to connect to the server. /check.asp,line 25 请帮忙解决这个问题 检查此代码 <%@ Language=VBScript %> <html> <head> </head> <body> <% dim to_field,message to_field = Request.Form("to_field") message = Request.Form("message") 'Create the e-mail server object Set objCDOSYSMail = Server.CreateObject("CDO.Message") Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 'Out going SMTP server objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDOSYSCon.Fields.Update 'Update the CDOSYS Configuration Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = "admin@example.com" ' the address you want the email to be from objCDOSYSMail.TO = "anuradha@gmail.com" 'the address the mail is to be sent to objCDOSYSMail.Subject = "Subject goes here" objCDOSYSMail.HTMLBody = "fffffffffff" objCDOSYSMail.Send 'Close the server mail object Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing %> <p>Mail sent successfully to address <%=to_field%>!</p> </body> </html> 解决方法
您需要在发送前添加您的用户名和密码.这是因为您在sendusing的字段中使用了值2.这意味着您正在使用身份验证.
'Your UserID on the SMTP server' objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourusername" 'Your password on the SMTP server' objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – ASP.net MVC RTM测试命名约定
- asp.net – 使用EF5从4.5降级到4.0后无法加载文件或程序集“
- asp.net-mvc – 用于对Office 365 AD进行身份验证的MVC
- ASP.NET MVC在javascript中使用ViewData
- asp.net – 双列表拖放控件
- asp.net-mvc – 如何在ActionFilterAttribute ASP MVC 5中为
- asp.net – GridView:选择页面按钮(数字)样式
- asp.net-mvc-3 – 显示模型中外键属性的显示值
- asp.net – 重定向到一个页面,其endResponse为true VS Comp
- ASP.NET 路由实现页面静态化
推荐文章
站长推荐
- asp.net – System.Diagnostics.Process.Start不
- asp.net – 如何在没有实体框架的MVC中使用Simpl
- azure – 如何减少Application Insights发送到服
- asp.net-mvc – Razor View语法无法识别HTML属性
- asp.net-mvc – 具有SelectList(s)最佳实践的ASP
- asp.net-mvc – CloudFlare SSL与ASP.NET MVC Re
- vbscript – 经典ASP 3.0从Recordset创建数组
- asp.net-mvc-3 – ASP.NET MVC3 CSS框架
- 经典的asp字符编码
- ASP.NET核心EF6身份
热点阅读