asp classic - asp CDO.Message.1 error '80040213' The transport failed to connect to the server. /check.asp, line 25 -
cdo.message.1 error '80040213' transport failed connect server. /check.asp, line 25
please solve problem
check code
<%@ language=vbscript %> <html> <head> </head> <body> <% dim to_field, message to_field = request.form("to_field") message = request.form("message") 'create 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 cdosys configuration set objcdosysmail.configuration = objcdosyscon objcdosysmail.from = "admin@example.com" ' address want email objcdosysmail.to = "anuradha@gmail.com" 'the address mail sent objcdosysmail.subject = "subject goes here" objcdosysmail.htmlbody = "fffffffffff" objcdosysmail.send 'close server mail object set objcdosysmail = nothing set objcdosyscon = nothing %> <p>mail sent address <%=to_field%>!</p> </body> </html>
you need add user name , password before sending. because used value of 2 in sendusing
's field. means you're using authentication.
'your userid on smtp server' objcdosyscon.fields.item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourusername" 'your password on smtp server' objcdosyscon.fields.item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"
Comments
Post a Comment