Platform SDK: Exchange 2000 Server

OnArrival Method

[This is preliminary documentation and subject to change.]

Called by the SMTP event source on bound OnArrival event sinks when a new message has arrived to the SMTP service.

[Visual Basic]
Sub OnArrival(ByVal Msg as CDO.Message, EventStatus as CdoEventStatus)
[C++]
HRESULT OnArrival(IMessage* Msg, CdoEventStatus* EventStatus);
[IDL]
HRESULT OnArrival([in] IMessage* Msg, [in,out] CdoEventStatus* EventStatus);
Msg
The IMessage interface on a Message object holding the message that arrived.
EventStatus
On return, the status of the event. The event sink signals to the source whether to continue notifying subsequent event sinks, or to stop and return. These values make up the CdoEventStatus enumeration in the type library.

Remarks

The Message object passed to the OnArrival method is in unexpanded format; the recipient addresses have not been resolved or expanded, and are thus still in the format in which the sending message transfer agent placed them in the message envelope.

For SMTP OnArrival events, the message content is read-write and can be modified by the sink. Additionally, some of the envelope fields can be modified. For more information, see SMTP/NNTP Transport Event Sinks with CDO.

The passed CDO Message object is bound to an ADO Stream object containing the message contents within the SMTP transport. To commit any changes you make to the transport content, call IDataSource.Save. This does not affect the EnvelopeFields collection. Changes to the EnvelopeFields collection for the message are committed to the transport using the Fields.Update method for the collection.

The transport ADO Stream object is required to modify the message contents in the SMTP transport. If you want to bind the Message object to another object within your sink, using for example IDataSource.OpenObject or IDataSource.SaveToObject, make sure to first retrieve the transport Stream object reference using the Message object's IDataSource.Source property. If you do not, you will not be able to rebind the Message object to the transport Stream object and consequently you will not be able to update the message contents in the transport.

The OnArrival event for the SMTP service is synchronous, meaning that the event dispatcher thread is blocked for the duration of time required for either all bound event sinks to be created (if necessary) and executed, or until a sink preemptively stops event notifications by returning the EventStatus parameter with the value cdoSkipRemainingSinks.

See Also

SMTP/NNTP Transport Event Sinks with CDO

CdoEventStatus Enum

IMessage Interface