Script Event Sink using Script Host Sink

Script Event Sink using Script Host Sink

Post by RGF2aWQgSy » Fri, 18 Aug 2006 05:55:02

I have registered the script host sink .dll with the server, wrapped it in a
COM+ application as I was instructed. I wrote the following script in
VBScript, and registered the script to the sink with the command:
cscript "C:\Program Files\Exchange SDK\Support\OLEDB\Scripts\RegEvent.vbs"
Add OnSave ExOleDB.ScriptEventSink.1
"file://./backofficestorage/[server]/mbx/[user]/inbox/onsaveevent" -file

The script that I wrote for this, very simply should send an email to myself
upon reciept of any other email:

Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, lFlags)
on error resume next
' Event sink code for support mailbox
Set CDOMailObj = CreateObject("CDO.Message")

' Set the properties of the object
CDOMailObj.From = "Administrator < XXXX@XXXXX.COM >"
CDOMailObj.Subject = "Issue Received"
CDOMailObj.TextBody = " Thank you for reporting your issue, "_
& "is has been logged as #40000000." & vbCrLf _
& "Thank you"
' Send the message
Set CDOMailObj = Nothing
End Sub

However, I do not recieve an email. When I run the script inbedded in an
Active Server Page, it works just fine. Please offer any advice possible.

Script Event Sink using Script Host Sink

Post by Glen Scale » Fri, 18 Aug 2006 10:01:24

Have you made sure the script is wrapped inside the following tags


You might also want to include some simple text file logging in your code eg
maybe the message is failing to be sent because the process doesn't have
access to the pickup directory or its trying to use the Outlook Express
configuration to send the email or its being caught by the IMF or other SPAM
filter etc. Its also a good idea to set the configuration to the method you
want to send by eg if you want to send the message via port 25 use something

CDOMailObj.Configuration.Fields.Item(" ")
= 2
CDOMailObj.Configuration.Fields.Item(" ")
= "server"
CDOMailObj.Configuration.Fields.Item(" ")
= 25