Results 1 to 2 of 2

Thread: Event Sinks...

  1. #1
    Tom Jones Guest

    Event Sinks...

    I am having some trouble getting event sinks to work here is my setup.

    I have a P4 Computer that has Win2k3 Standard and exchange 2k3 standard on
    it.

    I have created 3 different types of sinks and neither of them fire. Here is
    the code I have for a VBS event sink.

    Code---
    <SCRIPT LANGUAGE="VBScript">

    Sub IEventIsCacheable_IsCacheable

    ' just returns S_OK

    End Sub

    Sub ISMTPOnArrival_OnArrival(ByVal iMsg, EventStatus )

    On Error Resume Next

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set wFile = fso.OpenTextFile("c:\OnSave_Log.txt", 8, True)
    wfile.WriteLine ("Event Sink Fired at " & Now)
    wfile.WriteLine ("Script fired by me")

    EventStatus =0

    End Sub
    </SCRIPT>

    I register it using the following commands.

    cscript smtpreg.vbs /add 1 onarrival SMTPScriptingHost
    CDO.SS_SMTPOnArrivalSink "mail from=*"

    cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName
    "C:\NewMail.vbs"

    I am testing sending emails to exchange using the following C# code.

    try
    {
    MailMessage msg=new MailMessage();
    msg.To="testuser1@testdomain.test";
    msg.From ="testuser1@testdomain.test";
    msg.Subject ="Test Email";
    msg.Body ="Test Body";

    SmtpMail.SmtpServer ="the ip of the exchange box";
    SmtpMail.Send(msg);
    }
    catch(Exception ex)
    {
    Console.WriteLine(ex.ToString());
    }

    Any help would be nice.

  2. #2
    Chief Evil Officer Guest
    "Tom Jones" <csharpcoder2004@hotmail.com> wrote in message
    news:u7M3B%23OyEHA.3024@TK2MSFTNGP14.phx.gbl...
    I am having some trouble getting event sinks to work here is my setup.

    I have a P4 Computer that has Win2k3 Standard and exchange 2k3 standard on
    it.

    I have created 3 different types of sinks and neither of them fire. Here
    is
    the code I have for a VBS event sink.

    Code---
    SCRIPT LANGUAGE="VBScript"

    Sub IEventIsCacheable_IsCacheable

    ' just returns S_OK

    End Sub

    Sub ISMTPOnArrival_OnArrival(ByVal iMsg, EventStatus )

    On Error Resume Next

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set wFile = fso.OpenTextFile("c:\OnSave_Log.txt", 8, True)
    wfile.WriteLine ("Event Sink Fired at " & Now)
    wfile.WriteLine ("Script fired by me")

    EventStatus =0

    End Sub
    /SCRIPT

    I register it using the following commands.

    cscript smtpreg.vbs /add 1 onarrival SMTPScriptingHost
    CDO.SS_SMTPOnArrivalSink "mail from=*"

    cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName
    "C:\NewMail.vbs"

    I am testing sending emails to exchange using the following C# code.

    try
    {
    MailMessage msg=new MailMessage();
    msg.To="testuser1@testdomain.test";
    msg.From ="testuser1@testdomain.test";
    msg.Subject ="Test Email";
    msg.Body ="Test Body";

    SmtpMail.SmtpServer ="the ip of the exchange box";
    SmtpMail.Send(msg);
    }
    catch(Exception ex)
    {
    Console.WriteLine(ex.ToString());
    }

    Any help would be nice.

Similar Threads

  1. Event Sinks to copy messages
    By Keith in forum Deploy
    Replies: 1
    Last Post: 12-26-2005, 05:58 PM
  2. Event sinks stop firing
    By Sorry in forum Development
    Replies: 5
    Last Post: 10-28-2005, 03:33 PM
  3. Microsoft Exchange Event Sinks
    By in forum Development
    Replies: 2
    Last Post: 09-19-2005, 04:54 PM
  4. Event Sinks and Printing
    By Marsha in forum Administration
    Replies: 0
    Last Post: 04-07-2005, 07:13 PM
  5. Event Sinks
    By Tom Jones in forum Development
    Replies: 2
    Last Post: 11-25-2004, 11:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - CAD Forum