procedure
TForm1
.
SpeedButtonClick(Sender: TObject);
var
f:
Integer
;
name:
string
;
begin
cler;
if
work =
True
then
begin
try
Form1
.
TIdPOP
.
Connect();
if
Form1
.
TIdPOP
.
Connected =
True
then
begin
all:= Form1
.
TIdPOP
.
CheckMessages;
Form1
.
Label1
.
Caption:= IntToStr(all);
form1
.
Label3
.
Font
.
Color:= clLime;
form1
.
Label3
.
Caption:=
'> Последний просмотр был в '
+timeToStr(Now);
Form1
.
lst1
.
Clear;
for
f:=
1
to
all
do
begin
Form1
.
IdMessage2
.
Clear;
Form1
.
TIdPOP
.
Retrieve(f,Form1
.
IdMessage2);
Form1
.
IdMessage2
.
CharSet:=
'koi8-r'
;
if
Form1
.
IdMessage2
.
Subject =
''
then
begin
name:=
'Нет заголовка.'
;
dat:=
'not'
;
tim:=
'not'
;
end
else
begin
dat:= DateToStr(Form1
.
IdMessage2
.
Date);
name:= form1
.
IdMessage2
.
Subject;
tim:= TimeToStr(Form1
.
IdMessage2
.
Date);
end
;
Form1
.
lst1
.
Items
.
Add(
''
);
Form1
.
lst1
.
Items[f-
1
]:= IntToStr(f)+
' > '
+ name +
' : '
+dat+
' / '
+tim;
end
;
if
allMemory > all
then
allMemory:= all;
if
(allMemory <> all)
and
(first =
False
)
and
(Form2
.
CheckBox1
.
Checked =
True
)
then
theMail;
if
first =
True
then
begin
first:=
False
;
allMemory:= all;
end
;
end
;
except
Form1
.
Label3
.
Font
.
Color:= clRed;
form1
.
Label3
.
Caption:=
'> Превышен лимит времени TIME OUT !'
;
end
;
Form1
.
TIdPOP
.
Disconnect;
end
else
form1
.
Label3
.
Caption:=
'> Не установлены данные адреса! Войдите в НАСТРОЙКИ'
;
end
;