Asp classic asp CDO.Message.1错误';80040213';传输无法连接到服务器/check.asp,第25行

Asp classic asp CDO.Message.1错误';80040213';传输无法连接到服务器/check.asp,第25行,asp-classic,Asp Classic,请帮忙解决这个问题 检查此代码 CDO.Message.1 error '80040213' The transport failed to connect to the server. /check.asp, line 25 邮件已成功发送到地址 您需要在发送前添加用户名和密码。这是因为您在sendusing的字段中使用了值2。这意味着您正在使用身份验证 <%@ Language=VBScript %> <html> <head> </head

请帮忙解决这个问题

检查此代码

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/check.asp, line 25

邮件已成功发送到地址


您需要在发送前添加用户名和密码。这是因为您在
sendusing
的字段中使用了值2。这意味着您正在使用身份验证

<%@ 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>
'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"