Autor Beitrag
FriFra
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Do 03.07.03 11:19 
Ich hab mich bisher noch nicht so recht mit der SMTP-Server Komponente befasst. Mein Code liefert zwar in der Regel Dateien von der Grösse der Mails, diese sind aber leer und wenn ein Anhang dabei war ist die Grösse 0...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.IdSMTPServer1ReceiveRaw(ASender: TIdCommand;
  var VStream: TStream; RCPT: TIdEMailAddressList;
  var CustomError: string);
var
  FS: TFileStream;
begin
  // This is the main event for receiving the message itself if you are using
  // the ReceiveRAW method
  // The message data will be given to you in VSTREAM
  // Capture it using a memorystream, filestream, or whatever type of stream
  // is suitable to your storage mechanism.
  // The RCPT variable is a list of recipients for the message
  FS := TFileStream.Create('Out_' + RCPT.EMailAddresses + '_' +
    FormatDateTime('mmddyyyy_hhnnss', now) + '.txt', fmCreate);
  FS.Write(VStream, VStream.Size);
  FS.Free;
end;

_________________
Michael
(principal certified lotus professional - developer)