1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87:
| unit Main;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdMessageClient, IdPOP3,mmSystem;
type TForm1 = class(TForm) IdPOP31: TIdPOP3; IdMessage1: TIdMessage; ListBox1: TListBox; procedure FormCreate(Sender: TObject); procedure ListBox1Click(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject); var i : Integer; begin
IDPOP31.Host:= Euer Host; IDPOP31.Username := Username; IDPop31.Password := Passwort; IDPOP31.COnnect; Form1.Caption := 'Sie haben '+Inttostr(IDpop31.CheckMessages+1)+' Nachrichten auf dem Server, die zusammen '+InttoStr(IDpop31.RetrieveMailBoxSize div 1024)+ ' kb groß sind'; If IDpop31.CheckMessages >= 0 THen begin
end; For i := 0 to IDPop31.CheckMessages do begin IDMessage1.Clear; IDpop31.Retrieve(i,IDMessage1); LIstbox1.Items.Add( IDMessage1.From.Address+' '+IDMessage1.Subject+' '+DateToStr(IDMessage1.Date)+' '+IntToStr(IDpop31.RetrieveMsgSize(i) div 1024)+'kb'); end; SndPlaySound( 'Post.wav', SND_ASYNC ); end;
procedure TForm1.ListBox1Click(Sender: TObject); var Zahl,i : Integer; begin IDMessage1.Clear;
Zahl := ListBox1.Itemindex;
IDPop31.Retrieve(Zahl,Idmessage1);
for i := 0 to Pred(IdMessage1.MessageParts.Count) do begin If IdMessage1.MessageParts.Items[i] is TIdText Then begin ShowMessage('Email von : '+IDMessage1.From.Address + #13 +'vom : '+DatetoStr(IDMessage1.Date)+#13+'Betreff : '+IDMessage1.Subject+#13+#13 +TIdText(IdMessage1.MessageParts.Items[i]).Body.Text); end; end; end;
end. |