Hello everyone
I am having trouble auto-mailing via ASP Classic running under Windows Server 2012 r2; the error code is as follows:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/EnviaCorreo.asp, line 31
I was researching the error on the internet and most comment that it is due to changing port 587 to 25 since I am using an Office365 account, I pass the configuration:
Function EnviaMail(sDesde,sDestinatario,sCC,sAsunto,sCuerpo,html) Dim oMail,configMail Set oMail = Server.CreateObject("CDO.Message") Set configMail = Server.CreateObject ("CDO.Configuration") oMail.Subject = sAsunto oMail.From = sDesde oMail.To = sDestinatario oMail.CC = sCC if html then oMail.HTMLBody = sCuerpo else oMail.TextBody = sCuerpo end if With configMail.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 //587 doesn't work either) .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 90 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") ="user" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="pass" .Update End With Set oMail.Configuration = configMail oMail.Send // error (line 31) Set oMail = Nothing Set configMail = Nothing End Function
Apparently the configuration is fine, but the reality is that it does not run, therefore I assume that the problem is not in the script, why I comment this, because this same script I tried on another machine that has Windows 10 and it works without problem.
Thinking that maybe we should create some exit rule in Windows Firewall, enable ports 25 and 587 to see if this allowed me to send but it does not work either.
The truth is that I don't know what else to do,… could someone help me to solve this problem.
I appreciate in advance your time and service
Cheers