Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/09/2002, 16:46
Yoston
 
Fecha de Ingreso: mayo-2002
Mensajes: 83
Antigüedad: 23 años
Puntos: 0
Re: attachfile + Base de datos

Hola mira prueba algo parecido a esto a mi me funciona tanto con CDONTS como JMAIL

set msg = Server.CreateObject( "CDONTS.NewMail" )

msg.BodyFormat = 1 ' PlainText (0 = HTML)
msg.MailFormat = 0 ' MIME format (1 = Plain Text)

Dim numAttachments
numAttachments = 0

Dim strAttachments
strAttachments = Session("ATTACHMENTS")
'en Session("ATTACHMENTS") estarian los archivos separados por ; ejemplo a.txt; b.algo;... etc

If strAttachments <> "" Then
numAttachments = 1
End If

Dim arrAttachments
If Instr(strAttachments, ";") Then
arrAttachments = split( strAttachments, "; " )
numAttachments = uBound(arrAttachments)+1
End If

If Session("ATTACHMENTS") <> "" Then
Set fso = CreateObject("Scripting.FileSystemObject&quot ;)
If numAttachments > 1 Then
If VarType(arrAttachments) <> 0 Then
For i = 0 To uBound(arrAttachments)
attachedFile = Tu_Directorio& "\" & arrAttachments(i)
If fso.FileExists( attachedFile ) Then
msg.AttachFile( attachedFile )
End If
Next
End If
Else
attachedFile = Tu_Directorio & "\" & Session("ATTACHMENTS")
If fso.FileExists( attachedFile ) Then
msg.AttachFile( attachedFile )
End If
End If
Set fso=nothing
End If
.
.
.
msg.send

espero que te sirva chausito...