Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/11/2003, 15:15
developer
Usuario no validado
 
Fecha de Ingreso: abril-2002
Ubicación: Mexico DF
Mensajes: 41
Antigüedad: 23 años, 1 mes
Puntos: 0
Ayuda con Exchange Server y ASP

Hola que tal estoy desarrollando un event sink en el exchenge server para que me notifique cada cuando se manda un correo a x dominio, el problema que tengo es q no puedo guardar el evento a una base de datos, si no que lo estoy creando en un txt, y no es tan funcional como si se fuera directo a la base, alguien ha realizado algo similar ?

adjunto mi codigo saludos.


<SCRIPT LANGUAGE="VBScript">
On Error Resume Next
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
TextDisclaimer = Msg.To
HTMLDisclaimer = Msg.To
If Msg.HTMLBody <> "" Then
'Search for the "</body>" tag and insert our discliamer before that tag.
pos = InStr(1, Msg.HTMLBody, "</body>", vbTextCompare)
szPartI = Left(Msg.HTMLBody, pos - 1)
szPartII = Right(Msg.HTMLBody, Len(Msg.HTMLBody) - (pos - 1))
Msg.HTMLBody = szPartI + HTMLDisclaimer + szPartII
Msg.TextBody = Msg.TextBody & vbCrLf & TextDisclaimer & vbCrLf
cont = ""
Else
Msg.TextBody = Msg.TextBody & vbCrLf & TextDisclaimer & vbCrLf
cont = left (Msg.TextBody,30)
End If

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''
Const ForReading = 1, ForAppending = 8
Dim fso, f, m
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("I:\Archivo.txt", ForAppending, True)
f.Close
Set f = fso.OpenTextFile("I:\Archivo.txt", ForReading)
m = f.ReadAll
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("I:\Archivo.txt", True)
tf.WriteLine( m & msg.To & msg.Bcc & msg.CC & "~"& msg.Subject &"\"& cont & chr(124)& Chr(10) )
tf.Close
set tf = nothing
set fso = Nothing

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''
Msg.DataSource.Save ' Commit the changes into the transport Stream
pEventStatus = cdoRunNextSink
End Sub
</SCRIPT>


'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''

En lugar de que se guarde en el txt quiero mandarlo a una base de datos espero q me puedan ayudar