Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Thu, 13 Oct 2005 06:43:04 -0700,    group: microsoft.public.exchange2000.development        back       


ISMTPOnArrival_OnArrival   
Hi,
   I have installed Exchange server in my machine and I try to make a log 
file when new mail comes to my exchange. For that I have created a file 
called SMTPMsgCheck.vbs, which contains the following code.
--------------------------------------------------------------------------
<SCRIPT LANGUAGE="VBScript">
On Error Resume Next

Const cdoRunNextSink = 0

Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
 
Dim fs 
Set fs = CreateObject("Scripting.FileSystemObject") 
Dim file 
Set file = fs.OpenTextFile("c:\Eventsink\log.txt", 8, True ) 
file.Write "------- New mail arrived ----------" & vbCrLf 
file.Close
EventStatus = cdoRunNextSink

End Sub

</SCRIPT>
-------------------------------------------------------------------------------

and I registered this script as

Cscript smtpreg.vbs /add 1 onarrival SMTPMessageCheck 
CDO.SS_SMTPOnArrivalSink "mail from=*"
Cscript smtpreg.vbs /setprop 1 onarrival SMTPMessageCheck Sink ScriptName 
"C:\EventSink\SMTPMsgCheck.vbs"

I have created a log.text file in "c:\Eventsink\" folder.

I restart my smtp protocols in exchange server. I am sending and receiving 
mails in the server. but my 'log' file is not getting updated. any problem in 
my code?

Please help me.

Aambal
date: Thu, 13 Oct 2005 06:43:04 -0700   author:   Aambal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us