Internet Direct (Indy) Version 9.0.2 Beta
TIdSMTPServer.OnReceiveMessage
Event handler signalled when reading and parsin incoming mail into a message instance.

property OnReceiveMessage: TOnReceiveMessage;
Description
OnReceiveMessage is a TOnReceiveMessage property that represents the event handler signalled when a threaded client connection reads and processes incoming mail data. OnReceiveMessage is used in the SMTP DATA command event handler when ReceiveMode contains the value rmMessage.

The command event handler creates a TIdMessage instance to hold the values in the incoming data, and captures message headers found in the incoming mail.

Applications must assign a procedure to the OnReceiveMessage event handler to allow processing of the message header data or email addresses in the recipient list for the client connection. If OnReceiveMessage is unassigned, an EIdTCPServerError exception will be raised.

OnReceiveMessage must fully process the message instance containing the message headersy, since the message instance will be freed prior to exiting from the DATA command action handler.