Event Sinks...
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Event Sinks...

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Tom Jones
Guest





Posted: Sat Nov 13, 2004 1:40 am    Post subject: Event Sinks... Reply with quote

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.

Back to top
Chief Evil Officer
Guest





Posted: Tue Nov 16, 2004 3:55 am    Post subject: Re: Event Sinks... Reply with quote

"Tom Jones" <csharpcoder2004@hotmail.com> wrote in message
news:u7M3B%23OyEHA.3024@TK2MSFTNGP14.phx.gbl...
Quote:
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.

Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB