Topic Path: Pending > TIdSMTPServer.OnCommandRCPT

Event handler signalled during execution of the SMTP RCPT command.

OnCommandRCPT is a THasAddress event handler property that represents the event handler signalled when executing the SMTP RCPT command using CommandHandlers for the threaded client connection. 

The SMTP RCPT command is used to identify an individual recipient of the mail data. Multiple recipients are specified by multiple use of this command. The argument field contains an email address that is the destination mailbox for the mail data, and may contain optional parameters. 

If service extensions were negotiated, when ALlowEHLO is True, the RCPT command may also carry parameters associated with a particular service extension offered by the server. The client must not transmit parameters other than those associated with a service extension offered by the server in its EHLO response. 

The SMTP server implementation provides a RCPT command action handler that performs processing required prior to signalling the OnCommandRCPT event handler. The command action handler ensures that the client connection has been identified using the HELO or EHLO command. If the client has not been identified, the text in Messages.Greeting.NoHello is sent to the client connection. 

The RCPT command action handler parses values in ASender.UnparsedParams, and constructs a email address that can be used in the OnCommandRCPT event handler. 

The SMTP server implementation must assign a procedure to the OnCommandRCPT event handler to allow responding to the TIdHasAddress event notification. 

The OnCOmmandRCPT event handler is responsible for determining if subsequent mail data can be Accepted, if delivery of mail data requires Forwarding, and assigning any custom error messages that occur during the event handler. 

When no error messages are generated in OnCommanRCPT, the email addresses are assigned to ASender.RcptList for the threaded client connection. If error messages are detected, the text in the errror message is sent to the client connection. 

When OnCommandRCPT is unassigned, the parsed email addresses are assigned to ASender.RcptList, and the text in Messages.RcpReplies.AddressOkReply is sent to client connection.

THasAddress Messages TIdCommandHandlers TIdCommand

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.