Platform SDK: SMTP Server Events |
[This is preliminary documentation and subject to change.]
Const GUID_SourceType = "{fb65c4dc-e468-11d1-aa67-00c04fa345f6}" Const GUID_SmtpSource = "{1b3c0666-e470-11d1-aa67-00c04fa345f6}" Const GUID_EventType = {COMCAT GUID FOR EVENT} Dim Manager Dim SourceType Dim Source Dim Bindings Dim Binding Dim BindingManager Dim GUID_Source Set Manager = CreateObject("Event.Manager") Set SourceType = Manager.SourceTypes(GUID_SourceType) Set Util = CreateObject("Event.Util") ' Get the source guid for SMTP service instance 1 Set GUID_Source = Util.GetIndexedGUID(GUID_SmtpSource, 1) Set Source = SourceType.Sources(GUID_Source) Set BindingManager = Source.GetBindingManager Set Bindings = BindingManager.Bindings(GUID_EventType) ' Leave the parameter to Add empty to automatically generate ' a GUID for the binding Set Binding = Bindings.Add("{GUID}") Binding.DisplayName = "My Binding" Binding.SinkClass = "MyComponent.MySinkClass" ' Source properties depend on the source. ' For SMTP, the Rule and Priority properties ' are defined. These may be blank Binding.SourceProperties.Add "Rule", "ehlo=*" Binding.SourceProperties.Add "priority", "40000" ' My sink uses custom Sink properties at runtime to affect ' its operation. I set these here. These only mean something ' to my sink. Binding.SinkProperties.Add "ArchiveLocation", CStr("c:\myarchive") Binding.SinkProperties.Add "DoArchive", True Binding.Save