SMTP/NNTP Transport Events Sinks with CDO

SMTP and NNTP Transport Event Sinks with CDO

The Microsoft® Windows® 2000 Simple Mail Transfer Protocol (SMTP) and Network News Transfer Protocol (NNTP) services provide an architecture for the addition of customized synchronous transport event sinks. A transport event occurs when some form of message data is transported into or out of the services. One common example of an inbound transport event is the arrival of a message to the SMTP service either over the network or in the SMTP pickup directory.

When such a transport event occurs, a source for this event notifies (executes) transport event sinks, each of which can take some type of action based on the data content of the message. The term synchronous event means that the event source performs no other action with the message data after passing it to the sink until the sink has returned. In other words, the source is blocked for the duration of the sink's execution. While the sink is executing, it has exclusive control of the message data and state.

The architecture for the SMTP and NNTP source and sink event system is based on the Component Object Model (COM). A transport event sink is defined as any COM object that implements the appropriate COM interface for the event. An event source is defined as a process or thread that notifies sinks using the COM run time when a particular event has occurred. The source needs no information about the internal details of the sink; its only requirements are that the sink be a COM object and that it implements the required COM interface.

You can use the Microsoft® Collaboration Data Objects (CDO) for Microsoft Windows 2000 and CDO for Microsoft® Exchange® 2000 COM components to create event sinks for the set of SMTP and NNTP transport events described in the following documentation. You can create these sinks in any programming or scripting language that supports COM and OLE Automation, including programming languages such as Microsoft® Visual C++®, Microsoft® Visual Basic®, and Microsoft® Visual J++®; and scripting languages such as Visual Basic, Scripting Edition (VBScript), and Microsoft® JScript®.

Note   If an SMTP event sink changes a message after the user has digitally signed it, the accompanying digital signature will be invalid. If an event sink modifies the body of a signed message, the sink should remove the digital signature, the event sink should indicate why the signature will appear invalid, or the event sink should re-sign the message. SMTP event sinks cannot apply disclaimers or access the body of S/MIME and other encrypted messages when the encryption keys are unavailable.

Note

NNTP Event Sinks and SMTP Event Sinks will not work on Windows Vista because Windows Vista does not have an SMTP or NNTP service. We recommend that you use System.Net.Mail to send messages when you are running Windows Vista.