TIDSMTPServer

Giganews Newsgroups
Subject: TIDSMTPServer
Posted by:  Philip Taylor (philly_t…@hotmail.com)
Date: Mon, 1 Sep 2003

Hi,

I have a TIDSMTPServer which (currently receives an e-mail from outlook
express and then displays the sender, receiver etc in labels on a form.
For some reason the server is not picking up the header details of the
message and so displays blanks in the labels - however on the 2
authorisation stages it picks up both the sender and receiver.

Could somebody please point out where i have gone wrong, or send me a
working example of the receive stage of the server? (plus the property
settings).

Heres my code:

procedure TForm1.IdSMTPServer1CommandMAIL(const ASender: TIdCommand;
  var Accept: Boolean; EMailAddress: String);
begin
    label1.Caption := EMailAddress;
    accept := true;
end;

procedure TForm1.IdSMTPServer1CommandRCPT(const ASender: TIdCommand;
  var Accept, ToForward: Boolean; EMailAddress: String;
  var CustomError: String);
begin
    label2.Caption := EMailAddress;
    accept := true;
end;

procedure TForm1.IdSMTPServer1ReceiveMessage(ASender: TIdCommand;
  var AMsg: TIdMessage; RCPT: TIdEMailAddressList;
  var CustomError: String);
begin
    Label3.Caption := AMsg.Sender.Address;
    Label4.Caption := AMsg.ReceiptRecipient.Address;
    Label5.Caption := AMsg.Subject;
    Label6.Caption := AMsg.From.Address;

    Memo1.Lines := AMsg.Body;
end;

In object inspector i have:
Active = true
AllowEHLO = false
Authmode = false
NoDecode = False
NoEncode = false
RawStreamType = stFileStream
ReceiveMode = rmMessage

I have played with different combinations of allowEHLO, nodecode and
noencode but it doesnt seem to make much difference...

Help Please??

Regards

Philip

Replies