Re: SMTP Server - OnRcptTo and OnMsgReceive

Giganews Newsgroups
Subject: Re: SMTP Server - OnRcptTo and OnMsgReceive
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Mon, 26 Sep 2005

"Master Surfer" <mastersurfer…@web.de> wrote in message
news:9F3A915A91DBE240mastersurfer…@web.de...

> How can I use the list of receptionists on my server I got
> with the OnRcptTo event in the OnMsgReceive event?

Whenever the OnRcptTo event handler indicates that a recipient is ok, the
recipient is stored in the RCPTList property of the TIdSMTPServerContext
object that is then passed to the OnMsgReceive handler later on.  The
RCPTList is of type TIdEMailAddressList, ie:

    procedure TForm1.IdSMTPServer1MsgReceive(ASender: TIdSMTPServerContext;
AMsg: TIdStream; var LAction : TIdDataReply);
    var
        I: Integer;
    begin
        for I := 0 to ASender.RCPTList.Count-1 do
        begin
            // send AMsg to ASender.RCPTList[I].Address as needed...
        end;
    end;

Gambit

Replies

In response to

SMTP Server - OnRcptTo and OnMsgReceive posted by Master Surfer on Sun, 25 Sep 2005