Foros del Web » Programando para Internet » ASP Clásico »

Problema con el objeto Cdo

Estas en el tema de Problema con el objeto Cdo en el foro de ASP Clásico en Foros del Web. Hola, Tengo un problemilla que llevo tiempo arrastrando, les comento: Tengo contratado un hosting con una empresa americana, y tengo un codigo de asp que ...
  #1 (permalink)  
Antiguo 20/06/2008, 12:57
 
Fecha de Ingreso: mayo-2008
Mensajes: 4
Antigüedad: 16 años, 10 meses
Puntos: 0
Problema con el objeto Cdo

Hola,
Tengo un problemilla que llevo tiempo arrastrando, les comento:
Tengo contratado un hosting con una empresa americana, y tengo un codigo de asp que funciona perfecto en mi ordenador, pero en cuando lanzo ese codigo en mi web en su hosting me sale el siguiente error:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/includes/funciones.asp, line 168


El codigo es el siguiente:

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")

'This section provides the configuration information for the remote SMTP server.

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtpout.secureserver.net"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="[email protected]"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="secret"

ObjSendMail.Configuration.Fields.Update

'End remote SMTP server configuration section==

ObjSendMail.To = ToMail
ObjSendMail.Subject = Subject
ObjSendMail.From = FromMail & "(" & FromName & ")"

' we are sending a text email.. simply switch the comments around to send an html email instead
ObjSendMail.HTMLBody = Body
'ObjSendMail.TextBody = "this is the body"

ObjSendMail.Send

Set ObjSendMail = Nothing


No veo nada raro en el código, me podrián ayudar por favor!!!! es urgente.
  #2 (permalink)  
Antiguo 20/06/2008, 13:42
 
Fecha de Ingreso: abril-2005
Ubicación: chihuahua Mexico
Mensajes: 49
Antigüedad: 20 años
Puntos: 0
Respuesta: Problema con el objeto Cdo

que rollo caon yo mando correos con esta funcion que por hay me la encontre en el internet pruebala haber si t funciona

Function SendCDOEmail(smtpserver,username,password, strSubject, strBody,strFromAddress,strToAddress,strCc, intpriority, strBodyFormat)
'smtpserver = your smtp server name'username = the username required for smtp authorisation
'password= the password required for smtp autorisation
'strSubject= subject text
'strBody = body text / html
'strFromAddress= from whom the email will be sent
'strToAddress= who the email will be sent to
'strCc= to who the email will be Cc'd to
'intpriority= importance of email (0=low, 1=normal, 2=high)
'strBodyFormat= either HTML or text
' response.Write("<b>Debug Code:</b> subject = " & strSubject & " , Body = "& strBody & "From = " & strFromAddress & " ,To= " & strToAddress & " , cc= " & strCc & " , priority = " & intpriority & " , Body Format = " & strBodyFormat & "<br>" & vbcrlf) 'debug code
'set up connection
' send email using cdosys
dim objCDOSysCon, objCDOSysMail
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties
With objCDOSYSCon
'Outgoing SMTP server
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = username
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'CDO Port
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2'Timeout
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Fields.Update
End With
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Set and update email properties
With objCDOSYSMail
'0=Low, 1=Normal, 2=High
.Fields("urn:schemas:httpmail:importance").Value = intpriority
'0=low, 1=normal, 2=high
.From = strFromAddress
'who the email is from
.To = strToAddress
'who the email is sent to
.Cc = strCc
'who the email is Cc'd to'The subject of the email
.subject = strSubject
'set the email body format
if ucase(strBodyFormat) ="HTML" then
.HTMLBody = strBody
else.textbody = strbody
end if
.fields.update
On Error Resume Next
.send
SendCDOEmail=Err
end with
'clean up
set objCDOSysMail = nothingset
objCDOSysCon = nothing
End Function


y asi de pelada la llamas

call SendCDOEmail("servidor","usuario","password","¡Bie nvenido ","texto del body","de quien","para quien","","1","HTML")
  #3 (permalink)  
Antiguo 20/06/2008, 13:43
 
Fecha de Ingreso: abril-2005
Ubicación: chihuahua Mexico
Mensajes: 49
Antigüedad: 20 años
Puntos: 0
Respuesta: Problema con el objeto Cdo

si no ps ya a de ser pedo del server y ps q t lo arregeln los del hostin creo yo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:50.