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

Error en codigo

Estas en el tema de Error en codigo en el foro de ASP Clásico en Foros del Web. ¡Hola a todos! :) Les comento que tengo un problemita con este còdigo: ********************************************* <% 'Vamos a mandar un mail! Dim sDestintatario, sAsunto, sCuerpo Dim ...
  #1 (permalink)  
Antiguo 13/03/2002, 09:49
 
Fecha de Ingreso: febrero-2002
Mensajes: 184
Antigüedad: 22 años, 3 meses
Puntos: 0
Error en codigo

¡Hola a todos! :)

Les comento que tengo un problemita con este còdigo:

*********************************************
<%

'Vamos a mandar un mail!
Dim sDestintatario, sAsunto, sCuerpo
Dim oMail 'el objeto CDO

sAsunto="2º prueba"
sDestinatario="[email protected]"

'Enviamos el email
set oMail=Server.CreateObject("CDONTS.NewMail&quo t;)

'Establecemos las propiedades del objeto
oMail.From = "Enrique,<[email protected]>&quot ;
oMail.To = sdestinatario
oMail.Subject = "nuevo mensaje"
oMail.Body = "dfsgsdfgdfsgsdfg"
oMail.Importance = 1
'envía el mail con urgencia (0=Baja, 1=Normal, 2=Alta).

oMail.AttachFile ="archivo.doc"

' Enviamos el email!
oMail.Send

set oMail = nothing
Response.Write ("Mensaje enviado.")

%>
*********************************************




Me tira el siguiente mensaje de error:

*********************
El objeto no acepta esta propiedad o método: 'AttachFile'
*********************
Obviamente el problema està en la lìnea:
oMail.AttachFile ="archivo.doc"

Pero para mi està todo bien.

Les aclaro que tengo Güindou 2000 server con IIS.

Muchas gracias :)

Enrique2

  #2 (permalink)  
Antiguo 13/03/2002, 12:25
Avatar de DanielRey
Usuario no validado
 
Fecha de Ingreso: enero-2001
Ubicación: Mendoza
Mensajes: 630
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Error en codigo

Hola Mauro Viale

No manejo mucho ese objeto :( pero uso esta sintaxis:
oMail.Attachfile "c:\InetPub\wwwroot\AN00790_.gif", "AN00790_.gif", 1

La semántica la desconozco, pero imagino que el primer parámetro es la ruta completa del archivo a enviar, el segundo es el nombre y el tercero... lo ignoro por completo.

Probalo, en una de esas te sirve.

Suerte
  #3 (permalink)  
Antiguo 14/03/2002, 09:34
Avatar de Aston  
Fecha de Ingreso: mayo-2001
Ubicación: Madrid
Mensajes: 933
Antigüedad: 23 años, 1 mes
Puntos: 0
Re: Error en codigo

Hola amigos, ahí va la sintaxis del método, por si os puede servir. Está en inglés pero se entiende:

AttachFile Method (CDONTS NewMail Object)

The AttachFile method adds an attachment to the message by reading a file.

Syntax

objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )

objNewMail

Required. This NewMail object.

Source

Required. IStream object or String. The full path and file name of the file to be attached to the message, or a pointer to an IStream object containing the file data.

FileName

Optional. String. The file name to appear in the attachment's placeholder in the message. If FileName is not supplied, the file name from the Source parameter is used.

EncodingMethod

Optional. Long. The manner of encoding the attachment. The following values are possible: EncodingMethod setting Value Description
CdoEncodingUUencode 0 The attachment is to be in UUEncode format (default).
CdoEncodingBase64 1 The attachment is to be in base 64 format.


Remarks

The default value for the EncodingMethod parameter can change if you set the MailFormat property. If MailFormat is set to CdoMailFormatText, the default value is CdoEncodingUUencode. If MailFormat is set to CdoMailFormatMime, the default value is CdoEncodingBase64. However, if you add an attachment encoded in base 64 format, the value of the MailFormat property is automatically set to CdoMailFormatMime.

Only C/C++ and Java programs can use an IStream object for the Source parameter. They should pass an IUnknown object that returns an IStream interface in response to QueryInterface. Microsoft® Visual Basic® supports the IDispatch interface and not IUnknown, so it cannot use an IStream object.

Un saludo. :) ;)

<a href="http://www.laventanita.net/" target="_blank">
<img src="http://www.breogan.org/images/Aston.gif" border="0" alt="La Ventanita.net - Lo imprescindible en la red"></a>
  #4 (permalink)  
Antiguo 14/03/2002, 11:09
 
Fecha de Ingreso: febrero-2002
Mensajes: 184
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: Error en codigo

¡Muchas gracias Aston y Daniel!

Enrique2 ;)
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 00:33.