Microsoft KB Archive/263476

= PRB: Cannot Implement Multiple Transport Event Methods in the Same File with JScript =

Article ID: 263476

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Collaboration Data Objects 2.0

-



This article was previously published under Q263476



SYMPTOMS
You cannot implement multiple event methods for Simple Mail Transfer Protocol (SMTP) and Microsoft Network News Transport Protocol (NNTP) transport events with a single script file using Microsoft JScript scripting language. If multiple event methods are present within the same file, then an exception occurs during run time and causes the SMTP/NNTP services to stop responding or hang.



CAUSE
This problem ocurrs due to a limitation in the JScript scripting engine.



RESOLUTION
To resolve this problem, you must use a separate file for each event with JScript.



MORE INFORMATION
The following are examples of separate files for JScript events.

Smtponarrival.js:  function ISMTPOnArrival::OnArrival(Msg, Status) { // Sink the code here. }  Nntponpost.js:  function INNTPOnPost::OnPost(Msg, Status) { // Sink the code here. }  Nntponpostearly.js:  function INNTPOnPostEarly::OnPostEarly(Msg, Status) { // Sink the code here. }  Nntponpostfinal.js:  function INNTPOnPostFinal::OnPostFinal(Msg, Status) { // Sink the code here. }  The Microsoft Developer Network (MSDN) January 2000 release documentation for the topic, &quot;Implementing Sinks with Scripting Languages,&quot; states the following:

&quot;One script file can contain code for multiple (or all) events.&quot;

This is an incorrect statement and is corrected in the MSDN April 2000 release.

NOTE: When you use VBScript, you can place all the event method implementations within a single file.

