unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdMessageClient, IdPOP3, StdCtrls, IdMessage, ComCtrls, Menus;
type
TForm1 = class(TForm)
Button1: TButton;
al: TIdPOP3;
ListView1: TListView;
IdMessage1: TIdMessage;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label8: TLabel;
Button4: TButton;
SaveDialog1: TSaveDialog;
Memo1: TMemo;
ListBox1: TListBox;
Button5: TButton;
PopupMenu1: TPopupMenu;
bymxx1: TMenuItem;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure ListView1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
al.Username:=edit1.Text;
al.Password:=edit2.Text;
al.Host:=edit3.Text;
al.Connect();
showmessage('tamam');
except
showmessage('olmadı');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
al.Disconnect;
end;
procedure TForm1.Button3Click(Sender: TObject);
var i,adet,boyut:integer;
begin
adet:=al.CheckMessages;
if adet=0 then
begin
showmessage('mesaj bulunamadı');
exit;
end;
listview1.Clear;
for i:=1 to adet do
begin
idmessage1.Clear;
al.RetrieveHeader(i,idmessage1);
with listview1.Items.Add do
begin
caption:=idmessage1.Subject;
subitems.add(idmessage1.from.text);
subitems.add(datetostr(idmessage1.Date));
subitems.add(inttostr(al.RetrieveMsgSize(i)));
end;
end;
end;
procedure TForm1.ListView1Click(Sender: TObject);
var i:integer;
begin
if listview1.Selected=nil then exit;
idmessage1.Clear;
memo1.Clear;
al.Retrieve(listview1.Selected.index+1,idmessage1);
caption:=inttostr(listview1.selected.index);
edit4.text:=idmessage1.from.text;
edit5.text:=idmessage1.cclist.emailaddresses;
edit6.text:=datetimetostr(idmessage1.date);
edit7.text:=idmessage1.subject;
memo1.Lines.AddStrings(idmessage1.Body);
listbox1.clear;
for i:=0 to pred(idmessage1.messageparts.count) do
if (idmessage1.messageparts.items is tidattachment) then
listbox1.items.add(tidattachment(
idmessage1.messageparts.items).filename)
else
if idmessage1.messageparts.items is tidtext then
begin
memo1.Clear;
memo1.lines.AddStrings(tidtext(idmessage1.messageparts.items).Body);
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
var i:integer;
begin
for i:=0 to idmessage1.MessageParts.Count - 1 do
if idmessage1.MessageParts.Items is tidattachment then
begin
savedialog1.filename:=tidattachment(idmessage1.MessageParts.items).filename;
if savedialog1.execute then
tidattachment(idmessage1.MessageParts.items).SaveToFile(savedialog1.FileName);
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if listview1.Selected<>nil then
begin
al.Delete(listview1.Selected.index + 1);
listview1.selected.delete;
end;
end;
end.
uzun oldu ama inceleyin size tavsiyem kopyala yapıştır yapmayın hiçbirşey öğrenemezsiniz benden size bir tavsiye
bugünlük te bu kadar
kib by
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdMessageClient, IdPOP3, StdCtrls, IdMessage, ComCtrls, Menus;
type
TForm1 = class(TForm)
Button1: TButton;
al: TIdPOP3;
ListView1: TListView;
IdMessage1: TIdMessage;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label8: TLabel;
Button4: TButton;
SaveDialog1: TSaveDialog;
Memo1: TMemo;
ListBox1: TListBox;
Button5: TButton;
PopupMenu1: TPopupMenu;
bymxx1: TMenuItem;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure ListView1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
al.Username:=edit1.Text;
al.Password:=edit2.Text;
al.Host:=edit3.Text;
al.Connect();
showmessage('tamam');
except
showmessage('olmadı');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
al.Disconnect;
end;
procedure TForm1.Button3Click(Sender: TObject);
var i,adet,boyut:integer;
begin
adet:=al.CheckMessages;
if adet=0 then
begin
showmessage('mesaj bulunamadı');
exit;
end;
listview1.Clear;
for i:=1 to adet do
begin
idmessage1.Clear;
al.RetrieveHeader(i,idmessage1);
with listview1.Items.Add do
begin
caption:=idmessage1.Subject;
subitems.add(idmessage1.from.text);
subitems.add(datetostr(idmessage1.Date));
subitems.add(inttostr(al.RetrieveMsgSize(i)));
end;
end;
end;
procedure TForm1.ListView1Click(Sender: TObject);
var i:integer;
begin
if listview1.Selected=nil then exit;
idmessage1.Clear;
memo1.Clear;
al.Retrieve(listview1.Selected.index+1,idmessage1);
caption:=inttostr(listview1.selected.index);
edit4.text:=idmessage1.from.text;
edit5.text:=idmessage1.cclist.emailaddresses;
edit6.text:=datetimetostr(idmessage1.date);
edit7.text:=idmessage1.subject;
memo1.Lines.AddStrings(idmessage1.Body);
listbox1.clear;
for i:=0 to pred(idmessage1.messageparts.count) do
if (idmessage1.messageparts.items is tidattachment) then
listbox1.items.add(tidattachment(
idmessage1.messageparts.items).filename)
else
if idmessage1.messageparts.items is tidtext then
begin
memo1.Clear;
memo1.lines.AddStrings(tidtext(idmessage1.messageparts.items).Body);
end;
end;
procedure TForm1.Button4Click(Sender: TObject);
var i:integer;
begin
for i:=0 to idmessage1.MessageParts.Count - 1 do
if idmessage1.MessageParts.Items is tidattachment then
begin
savedialog1.filename:=tidattachment(idmessage1.MessageParts.items).filename;
if savedialog1.execute then
tidattachment(idmessage1.MessageParts.items).SaveToFile(savedialog1.FileName);
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if listview1.Selected<>nil then
begin
al.Delete(listview1.Selected.index + 1);
listview1.selected.delete;
end;
end;
end.
uzun oldu ama inceleyin size tavsiyem kopyala yapıştır yapmayın hiçbirşey öğrenemezsiniz benden size bir tavsiye
bugünlük te bu kadar
kib by