Problem solved.
I just added <SCRIPT LANGUAGE="VBScript"> and </SCRIPT> to my event handler.
Although script runs without <scritp> tags using cscript.exe.
This is a discussion on SMTP sink problem - Microsoft Exchange ; I have a strange problem on Exchange 2003. I registered SMTP sink on incoming email. First I tested it with small vbscript event handler (createfile.vbs) that simply creates a file on the server. Everything worked fine. Then I tried to ...
I have a strange problem on Exchange 2003.
I registered SMTP sink on incoming email. First I tested it with small
vbscript event handler (createfile.vbs) that simply creates a file on
the server. Everything worked fine. Then I tried to test my real event
handler. It's a small vbscript (createpost.vbs) that creates
customised post in public folder using ADO. Script itself works fine
when I run it on the server. I unregistered my dummy creatfile.vbs
script and registered new createitem.vbs. it does not work.
Is there any way to debug SMTP sink errors?
this is my createpost.vbs file that doesnot work on SMTP sink but
works when I run it on the server.
Sub IEventIsCacheable_IsCacheable()
'To implement the interface, and return S_OK implicitly
End Sub
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
Dim iMsg
Dim Conn
Dim InfoNT
Dim Info
Dim sFolderUrl
Set Conn = CreateObject("ADODB.Connection")
Set iMsg = CreateObject("CDO.Message")
sFolderUrl ="http://mercury/public/advisory"
Conn.Provider = "EXOLEDB.datasource"
Conn.Open sFolderUrl,"user","password"
Dim Flds
Set Flds = iMsg.Fields
With Flds
.Item("urn:schemas:httpmail:from") = "test"
.Item("urn:schemas:httpmail:subject")="test"
.Item("urn:schemas:httpmail:textdescription") ="body"
.Item("dbName") = "qFullName"
.Item("Organization") = "qCompanyName"
.Item("http://schemas.microsoft.com/exchange/outlookmessageclass")=
"IPM.Post.Advisory"
.Update
End With
Set iDsrc = iMsg.Datasource
iDsrc.SaveTo sFolderUrl & "/item112.eml", Conn
iDsrc.Save
End Sub
Problem solved.
I just added <SCRIPT LANGUAGE="VBScript"> and </SCRIPT> to my event handler.
Although script runs without <scritp> tags using cscript.exe.