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

Problemas al enviar un email

Estas en el tema de Problemas al enviar un email en el foro de ASP Clásico en Foros del Web. Tengo una página en mi web, desde ella quiero que el usuario ponga su email y le mande su contraseña...el problema está en que al ...
  #1 (permalink)  
Antiguo 11/04/2004, 21:06
Avatar de tork  
Fecha de Ingreso: noviembre-2003
Ubicación: Veracruz
Mensajes: 153
Antigüedad: 20 años, 7 meses
Puntos: 0
Exclamación Problemas al enviar un email

Tengo una página en mi web, desde ella quiero que el usuario ponga su email y le mande su contraseña...el problema está en que al momento que le da enviar (poniendo el email correctamente) sale el siguiente error:

ASP:
--------------------------------------------------------
Objeto Server error 'ASP 0177 : 800401f3'

Error en Server.CreateObject

functions/functions_send_mail.asp, line 153

800401f3

-----------------------------------------------------------

El código para mandar la contraseña es el siguiente:


ASP:
-----------------------------------------------------------
<%
'Function to send an e-mail
Function SendMail(ByVal strEmailBodyMessage, ByVal strRecipientName, ByVal strRecipientEmailAddress, ByVal strFromEmailName, ByVal strFromEmailAddress, ByVal strSubject, strMailComponent, blnHTML)

'Dimension variables
Dim objCDOSYSMail 'Holds the CDOSYS mail object
Dim objCDOMail 'Holds the CDONTS mail object
Dim objJMail 'Holds the Jmail object
Dim objAspEmail 'Holds the Persits AspEmail email object
Dim objAspMail 'Holds the Server Objects AspMail email object
Dim strEmailBodyAppendMessage 'Holds the appended email message


'Check the email body doesn't already have Web Wiz Forums
If blnLCode = True Then

'If HTML format then make an HTML link
If blnHTML = True Then
strEmailBodyAppendMessage = "<br /><br /><br /><hr />
Else
strEmailBodyAppendMessage = VbCrLf & VbCrLf & "---------------------------------------------------------------------------------------"
strEmailBodyAppendMessage = strEmailBodyAppendMessage & VbCrLf & "Software provided by Web Wiz Forums version " & strVersion & " - http://www.webwizforums.com"
strEmailBodyAppendMessage = strEmailBodyAppendMessage & VbCrLf & "Free ASP Bulletin Board System - Download your free copy today!"
End If
End If



'******************************************
'*** Mail components ****
'******************************************

'Select which email component to use
Select Case strMailComponent



'******************************************
'*** MS CDOSYS mail component ****
'******************************************

'CDOSYS mail component
Case "CDOSYS"

'Dimension variables
Dim objCDOSYSCon

'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDOSYS.Message")
Set objCDOSYSCon = Server.CreateObject ("CDOSYS.Configuration")

'Set and update fields properties
With objCDOSYSCon
'Out going SMTP server
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strOutgoingMailServer
'SMTP port
.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

With objCDOSYSMail
'Who the e-mail is from
.From = strFromEmailName & " <" & strFromEmailAddress & ">"

'Who the e-mail is sent to
.To = strRecipientName & " <" & strRecipientEmailAddress & ">"

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
If blnHTML = True Then
.HTMLBody = strEmailBodyMessage & strEmailBodyAppendMessage
Else
.TextBody = strEmailBodyMessage & strEmailBodyAppendMessage
End If

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Send
End with

'Close the server mail object
Set objCDOSYSMail = Nothing




'******************************************
'*** MS CDONTS mail component ****
'******************************************

'CDONTS mail component
Case "CDONTS"

'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

With objCDOMail
'Who the e-mail is from
.From = strFromEmailName & " <" & strFromEmailAddress & ">"

'Who the e-mail is sent to
.To = strRecipientName & " <" & strRecipientEmailAddress & ">"

'The subject of the e-mail
.Subject = strSubject

'The main body of the e-amil
.Body = strEmailBodyMessage & strEmailBodyAppendMessage

'Set the e-mail body format (0=HTML 1=Text)
If blnHTML = True Then
.BodyFormat = 0
Else
.BodyFormat = 1
End If

'Set the mail format (0=MIME 1=Text)
.MailFormat = 0

'Importance of the e-mail (0=Low, 1=Normal, 2=High)
.Importance = 1

'Send the e-mail
.Send
End With

'Close the server mail object
Set objCDOMail = Nothing




'******************************************
'*** w3 JMail mail component ****
'******************************************

'JMail component
Case "Jmail"

'Create the e-mail server object
Set objJMail = Server.CreateObject("JMail.SMTPMail")

With objJMail
'Out going SMTP mail server address
.ServerAddress = strOutgoingMailServer

'Who the e-mail is from
.Sender = strFromEmailAddress
.SenderName = strFromEmailName

'Who the e-mail is sent to
.AddRecipient strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.HTMLBody = strEmailBodyMessage & strEmailBodyAppendMessage
Else
.Body = strEmailBodyMessage & strEmailBodyAppendMessage
End If

'Importance of the e-mail
.Priority = 3

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Execute
End With

'Close the server mail object
Set objJMail = Nothing




'******************************************
'*** Persits AspEmail mail component ****
'******************************************

'AspEmail component
Case "AspEmail"

'Create the e-mail server object
Set objAspEmail = Server.CreateObject("Persits.MailSender")

With objAspEmail
'Out going SMTP mail server address
.Host = strOutgoingMailServer

'Who the e-mail is from
.From = strFromEmailAddress
.FromName = strFromEmailName

'Who the e-mail is sent to
.AddAddress strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.IsHTML = True
End If

'The main body of the e-mail
.Body = strEmailBodyMessage & strEmailBodyAppendMessage

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Send
End With

'Close the server mail object
Set objAspEmail = Nothing




'********************************************
'*** ServerObjects AspMail mail component ***
'********************************************

'AspMail component
Case "AspMail"

'Create the e-mail server object
Set objAspMail = Server.CreateObject("SMTPsvg.Mailer")

With objAspMail
'Out going SMTP mail server address
.RemoteHost = strOutgoingMailServer

'Who the e-mail is from
.FromAddress = strFromEmailAddress
.FromName = strFromEmailName

'Who the e-mail is sent to
.AddRecipient " ", strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.ContentType = "text/HTML"
End If

'The main body of the e-mail
.BodyText = strEmailBodyMessage & strEmailBodyAppendMessage

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .SendMail
End With

'Close the server mail object
Set objAspMail = Nothing
End Select

'Set the returned value of the function to true
SendMail = True
End Function
%>

--------------------------------------------------
¿¿¿¿¿¿Alguien me podría decir donde está el error??????
__________________
... www.kaomix.com ... :aplauso:
kao0 power
  #2 (permalink)  
Antiguo 11/04/2004, 22:07
Avatar de univercity  
Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 21 años, 7 meses
Puntos: 0
Uffff, y cual de estas as la linea 153????.... con cual componente es el que estas trabajando, se supone que de todos estos has elegido uno...
__________________
"Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein
  #3 (permalink)  
Antiguo 11/04/2004, 22:11
Avatar de tork  
Fecha de Ingreso: noviembre-2003
Ubicación: Veracruz
Mensajes: 153
Antigüedad: 20 años, 7 meses
Puntos: 0
El componente que estoy usando es

Set objCDOSYSMail = Server.CreateObject("CDOSYS.Message")
Set objCDOSYSCon = Server.CreateObject ("CDOSYS.Configuration")


ok?
__________________
... www.kaomix.com ... :aplauso:
kao0 power
  #4 (permalink)  
Antiguo 11/04/2004, 22:23
Avatar de univercity  
Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 21 años, 7 meses
Puntos: 0
Y la linea 153 me imagino es esta misma, bueno yo lo primero que probaría es si el componente es compatible con el server que estas utilizando.
Estas usando un codigo hecho (Web Wiz Forums), y creo yo que ellos ya probrarón todo los codigos, para mi debes probar con el resto de los componentes, yo partiría con Cdonts...
__________________
"Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein
  #5 (permalink)  
Antiguo 12/04/2004, 22:19
Avatar de tork  
Fecha de Ingreso: noviembre-2003
Ubicación: Veracruz
Mensajes: 153
Antigüedad: 20 años, 7 meses
Puntos: 0
Exclamación Problemas al enviar email

Ayuda.......En mi web tengo el servicio de mandar la contraseña por email, el usuario únicamente pone su email y la contraseña es enviada, el problema está en que al dar click en enviar aparece el siguiente error:

Objeto Server error 'ASP 0177 : 800401f3'

Error en Server.CreateObject

/functions/functions_send_mail.asp, line 153

800401f3

-----------------------------------------------------------
El código para mandar el mensaje es el siguiente:

<%
'Function to send an e-mail
Function SendMail(ByVal strEmailBodyMessage, ByVal strRecipientName, ByVal strRecipientEmailAddress, ByVal strFromEmailName, ByVal strFromEmailAddress, ByVal strSubject, strMailComponent, blnHTML)

'Dimension variables
Dim objCDOSYSMail 'Holds the CDOSYS mail object
Dim objCDOMail 'Holds the CDONTS mail object
Dim objJMail 'Holds the Jmail object
Dim objAspEmail 'Holds the Persits AspEmail email object
Dim objAspMail 'Holds the Server Objects AspMail email object
Dim strEmailBodyAppendMessage 'Holds the appended email message


'Check the email body doesn't already have Web Wiz Forums
If blnLCode = True Then

'If HTML format then make an HTML link
If blnHTML = True Then
strEmailBodyAppendMessage = "<br /><br /><br /><hr />Software provided by <a href=""""></a> version " & strVersion & " - http://<br /> - <strong></strong>!"
'Else do a text link
Else
strEmailBodyAppendMessage = VbCrLf & VbCrLf & "---------------------------------------------------------------------------------------"
strEmailBodyAppendMessage = strEmailBodyAppendMessage & VbCrLf & "Software " & strVersion & " - http://"
strEmailBodyAppendMessage = strEmailBodyAppendMessage & VbCrLf & "!"
End If
End If



'******************************************
'*** Mail components ****
'******************************************

'Select which email component to use
Select Case strMailComponent



'******************************************
'*** MS CDOSYS mail component ****
'******************************************

'CDOSYS mail component
Case "CDOSYS"

'Dimension variables
Dim objCDOSYSCon

'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDOSYS.Message")
Set objCDOSYSCon = Server.CreateObject ("CDOSYS.Configuration")

'Set and update fields properties
With objCDOSYSCon
'Out going SMTP server
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strOutgoingMailServer
'SMTP port
.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

With objCDOSYSMail
'Who the e-mail is from
.From = strFromEmailName & " <" & strFromEmailAddress & ">"

'Who the e-mail is sent to
.To = strRecipientName & " <" & strRecipientEmailAddress & ">"

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
If blnHTML = True Then
.HTMLBody = strEmailBodyMessage & strEmailBodyAppendMessage
Else
.TextBody = strEmailBodyMessage & strEmailBodyAppendMessage
End If

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Send
End with

'Close the server mail object
Set objCDOSYSMail = Nothing




'******************************************
'*** MS CDONTS mail component ****
'******************************************

'CDONTS mail component
Case "CDONTS"

'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

With objCDOMail
'Who the e-mail is from
.From = strFromEmailName & " <" & strFromEmailAddress & ">"

'Who the e-mail is sent to
.To = strRecipientName & " <" & strRecipientEmailAddress & ">"

'The subject of the e-mail
.Subject = strSubject

'The main body of the e-amil
.Body = strEmailBodyMessage & strEmailBodyAppendMessage

'Set the e-mail body format (0=HTML 1=Text)
If blnHTML = True Then
.BodyFormat = 0
Else
.BodyFormat = 1
End If

'Set the mail format (0=MIME 1=Text)
.MailFormat = 0

'Importance of the e-mail (0=Low, 1=Normal, 2=High)
.Importance = 1

'Send the e-mail
.Send
End With

'Close the server mail object
Set objCDOMail = Nothing




'******************************************
'*** w3 JMail mail component ****
'******************************************

'JMail component
Case "Jmail"

'Create the e-mail server object
Set objJMail = Server.CreateObject("JMail.SMTPMail")

With objJMail
'Out going SMTP mail server address
.ServerAddress = strOutgoingMailServer

'Who the e-mail is from
.Sender = strFromEmailAddress
.SenderName = strFromEmailName

'Who the e-mail is sent to
.AddRecipient strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.HTMLBody = strEmailBodyMessage & strEmailBodyAppendMessage
Else
.Body = strEmailBodyMessage & strEmailBodyAppendMessage
End If

'Importance of the e-mail
.Priority = 3

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Execute
End With

'Close the server mail object
Set objJMail = Nothing




'******************************************
'*** Persits AspEmail mail component ****
'******************************************

'AspEmail component
Case "AspEmail"

'Create the e-mail server object
Set objAspEmail = Server.CreateObject("Persits.MailSender")

With objAspEmail
'Out going SMTP mail server address
.Host = strOutgoingMailServer

'Who the e-mail is from
.From = strFromEmailAddress
.FromName = strFromEmailName

'Who the e-mail is sent to
.AddAddress strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.IsHTML = True
End If

'The main body of the e-mail
.Body = strEmailBodyMessage & strEmailBodyAppendMessage

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .Send
End With

'Close the server mail object
Set objAspEmail = Nothing




'********************************************
'*** ServerObjects AspMail mail component ***
'********************************************

'AspMail component
Case "AspMail"

'Create the e-mail server object
Set objAspMail = Server.CreateObject("SMTPsvg.Mailer")

With objAspMail
'Out going SMTP mail server address
.RemoteHost = strOutgoingMailServer

'Who the e-mail is from
.FromAddress = strFromEmailAddress
.FromName = strFromEmailName

'Who the e-mail is sent to
.AddRecipient " ", strRecipientEmailAddress

'The subject of the e-mail
.Subject = strSubject

'Set the e-mail body format (BodyHTML=HTML Body=Text)
If blnHTML = True Then
.ContentType = "text/HTML"
End If

'The main body of the e-mail
.BodyText = strEmailBodyMessage & strEmailBodyAppendMessage

'Send the e-mail
If NOT strOutgoingMailServer = "" Then .SendMail
End With

'Close the server mail object
Set objAspMail = Nothing
End Select

'Set the returned value of the function to true
SendMail = True
End Function
%>
------------------------------------------------------------------
Gracias de antemano
__________________
... www.kaomix.com ... :aplauso:
kao0 power
  #6 (permalink)  
Antiguo 13/04/2004, 00:28
 
Fecha de Ingreso: diciembre-2001
Mensajes: 199
Antigüedad: 22 años, 5 meses
Puntos: 0

Última edición por forastero; 13/04/2004 a las 20:55
  #7 (permalink)  
Antiguo 13/04/2004, 07:40
Avatar de univercity  
Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 21 años, 7 meses
Puntos: 0
Y yo que pensé que ya lo habias solucionado!!!!.... pero si este es un codigo bajado, y los amigos Web Wiz Forums, ya han probado todos los codigos, tu simplemente no estas usando el componente apropiado para tu configuración, el foro debe tener el apartado de ADMINISTRACION, y alguna parte debe estar MAIL, cambia el 'CDOSYS, por otro como recomendacion prueba con CDONTS...

no esperes que leamos todo ese codigo que haz dejado, porque en el estan todas las posibilidades que te estan dando para poder enviar el mail,

Dim objCDOSYSMail 'Holds the CDOSYS mail object
Dim objCDOMail 'Holds the CDONTS mail object
Dim objJMail 'Holds the Jmail object
Dim objAspEmail 'Holds the Persits AspEmail email object
Dim objAspMail 'Holds the Server Objects AspMail email object
Dim strEmailBodyAppendMessage 'Holds the appended email message


Slds.
__________________
"Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein
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 22:54.