Kurde juz tyle czas mineło a ja jeszcze tego nie zrobiłem.Coś mi nie idze.Jak ktoś wie kurcze pliz powiedzcie jak to zrobić??
Aha mam takie cos ale ja nie wiem jakie sąto komponęty i jakie im dać nazwy
Sieci globalne
Programowaie aplikacji sieciowych w systemie Delphi
protokół POP3
Zapoznac sie z protokołem pocztowym Post Oce Protocol — POP3 (norma rfc1939),
a nastepnie napisac i uruchomic program do odbioru poczty oparty na zastosowaniu komponentu
klasy TIdPOP3 z pakietu Indy. Aby zrealizowac program mozna posłuzyc sie
fragmentami ponizszego kodu:
Nawiazanie połaczenia
POP.Host := Pop3ServerName;
POP.Port := Pop3ServerPort;
POP.UserID := Pop3ServerUser;
POP.Password := Pop3ServerPassword;
POP.Connect;
Informacja o skrzynce
FMsgCount := POP.CheckMessages;
FMailBoxSize := POP.RetrieveMailBoxSize div 1024;
Informacja o wiadomosciach
POP.RetrieveHeader(intIndex, IdMessage1);
itm := ListView1.Items.Add;
itm.Caption := IdMessage1.Subject; // temat
itm.SubItems.Add(IdMessage1.From.Text); // nadawca
itm.SubItems.Add(DateToStr(IdMessage1.Date)); // data
itm.SubItems.Add(IntToStr(POP.RetrieveMsgSize(intIndex))); // rozmiar
Odbiór poczty
POP.Retrieve(ListView1.Selected.Index + 1, IdMessage1);
LabelFrom.Caption := IdMessage1.From.Text;
LabelRecipients.Caption := IdMessage1.Recipients.EmailAddresses;
LabelCc.Caption := IdMessage1.CCList.EMailAddresses;
LabelSubject.Caption := IdMessage1.Subject;
LabelDate.Caption := FormatDateTime(’dd mmm yyyy hhss’,IdMessage1.Date);
LabelReceipt.Caption := IdMessage1.ReceiptRecipient.Text;
LabelOrganization.Caption := IdMessage1.Organization;
LabelPriority.Caption := IntToStr(Ord(IdMessage1.Priority) + 1);
for intIndex := 0 to Pred(IdMessage1.MessageParts.Count) do
begin
if (IdMessage1.MessageParts.Items[intIndex] is TIdAttachment) then
begin
li := ListViewMessageParts.Items.Add;
li.Caption :=
TIdAttachment(IdMessage1.MessageParts.Items[intIndex]).Filename;
end
else
begin //body text
if Msg.MessageParts.Items[intIndex] is TIdText then
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(
TIdText(IdMessage1.MessageParts.Items[intIndex]).Body);
end
end;
end;
Usuniecie wiadomosci
POP.Delete(intIndex);
Rozłaczenie
POP.Disconnect;