Autor Beitrag
Luisk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 16:54 
Hallo,
wie kann ich über die Delphi-Indy pop3 Komponente erkennen, wie viele neue, ungelesene mails auf einem Mailserver sind ?
Gibt es sowas wie einen Status bei jeder mail, die anzeigt, ob sie schon gelesen wurde? Alle abzufragen ist kein Problem.

Danke
Luis

Moderiert von user profile iconNarses: überflüssige Zeilenumbrüche entfernt
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 04.01.09 16:59 
Serverseitig nicht, du musst dir lokal speichern, welche du schon heruntergeladen hast ( uidls der Nachrichten reicht)

_________________
Markus Kinzler.
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 17:10 
Danke,
nicht gut, bräuchte die Info Serverseitig, da die mails von unterschiedlichen Rechnern u. Orten abgerufen werden.
In dieser IT-Branche funktioniert doch nichts, wie es sollte.
Gruß
Luis
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 04.01.09 17:11 
In diesem Fall solltest du statt POP3 IMAP verwenden

_________________
Markus Kinzler.
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 18:05 
Danke,
welche Komponenten brauche ich für IMAP ?
Gibt es evtl ein Demo hierzu?
Gruß Luis
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 04.01.09 19:21 
TIdIMAP. du musst hierfür aber Serverseitig einen IMAP-Server bzw. einen IMAP-fähigen Mailserver einsetzen. Was für einen Mailserver verwendest du? Beispiele sollten bei INDY/Delphi dabei sein

_________________
Markus Kinzler.
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 21:44 
Der Mailserver ist vorgegeben:
1und1 Webmailer
webmailcluster.1und1..._reuse=1231098071059

Luis
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 04.01.09 22:01 
Sollte IMAP unterstützen

_________________
Markus Kinzler.
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 22:16 
Bei Delphi6 hab ich nur TIdIMAP4server gefunden und leider kein Bsp.
Gibts im Netz evtl Beispiele?

Luis
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: So 04.01.09 22:21 
hier hab ich was gefunden,
aber Delphi 6 kennt anscheinend TidIMAP4 nicht
www.delphi-forum.de/viewtopic.php?p=533875

Luis
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Mo 05.01.09 02:11 
zunächst mal Danke für den Tip mit IMAP
------------------------------------------
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Button1Click(Sender: TObject);
var li:integer;
begin
    idImap41.Host := 'imap.1und1.de'// bzw. 'imap.web.de'
    idImap41.Username:= 'xxxx.xxx@xxxx';
    idImap41.Password:= 'xxxxx';
    idImap41.Connect(5000);
    showMessage('Connected');
      if idImap41.ConnectionState = csAuthenticated then
        if IdIMAP41.SelectMailBox('inbox'then begin
          showMessage('unseen:'+IntToStr(idImap41.MailBox.UnseenMsgs));
          showMessage('recent:'+IntToStr(IdIMAP41.MailBox.RecentMsgs));
          showMessage('complete:'+IntToStr(IdIMAP41.MailBox.TotalMsgs));
        end;
      idImap41.Disconnect;
end;

es läuft nun mit Delphi5 aber es gibt folgendes Problem:
idImap41.MailBox.UnseenMsgs zeigt immer 0 an
(damit ist die Funktion noch nicht brauchbar)
IdIMAP41.MailBox.RecentMsgs zeigt auch immer 0 an
IdIMAP41.MailBox.TotalMsgs zeit die richtige Anzahl an

bei imap.web.de ebenfalls
hat jemand ähnliche Erfahrugen gemacht ?

Danke für weitere Tips
Luis

Moderiert von user profile iconNarses: Delpih-Tags hinzugefügt

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

Der Zugriff erfolgt über diese Bibliothek:
indy9.0.18_source.zip
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 05.01.09 11:57 
Auch Indy's genannt.

Bitte schreibe deinen Delphi-Code in Delphi-Tags!Die findest du unter Bereich wenn du postest. :wink:

mfg,j.klugmann
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 05.01.09 12:08 
Dazu steht was in der Hilfe..

Zitat:
Declaration
property UnseenMsgs: LongInt;
Summary
Indicates the number of unread messages in the current mailbox.
Description
UnseenMsgs is a LongInt property that indicates the number of messages in the currently selected mailbox that have not been read by the IMAP4 client.
UnseenMsgs is updated when the results from the TIdIMAP4.StatusMailBox method are parsed.


Demnach musst du wohl erst den Status der Mailbox abfragen.

_________________
PROGRAMMER: A device for converting coffee into software.
Luisk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Mo 05.01.09 13:38 
Danke, an alle. Es läuft.
hier der Code:
ausblenden Delphi-Quelltext
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:
//-------------------------------------------------------------------------
function imap41_gib_Anzahl_ungelesene_mails(in_host,in_user,in_password:string
                                            ):integer;
var idImap41: TIdIMAP4;
    l_ungelesene:integer;
begin
   idImap41:=TIdIMAP4.create(nil);
   idImap41.Host    := in_host; // z.B. 'imap.web.de'
   idImap41.Username:= in_user;
   idImap41.Password:= in_password;
   idImap41.Connect(5000);
   result:=-1;
   if idImap41.ConnectionState = csAuthenticated then begin
      if IdIMAP41.SelectMailBox('inbox'then begin
         IdIMAP41.StatusMailBox('inbox',idImap41.MailBox); // Wichtig!!!!
         l_ungelesene:=idImap41.MailBox.UnseenMsgs;
         result:=l_ungelesene;
//          showMessage('unseen:'+IntToStr(l_ungelesene));
//          showMessage('recent:'+IntToStr(IdIMAP41.MailBox.RecentMsgs));
//          showMessage('complete:'+IntToStr(IdIMAP41.MailBox.TotalMsgs));
      end;
   end;
   idImap41.Disconnect;
   idImap41.destroy;
end;
//-------------------------------------------------------------------------


Gruß
Luis

Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt