Article View: borland.public.cppbuilder.internet.socket
Article #5311Re: Get list of new messages in POP3
From: Remy Lebeau (TeamB)
Date: Wed, 22 Sep 2004 20:14
Date: Wed, 22 Sep 2004 20:14
40 lines
2217 bytes
2217 bytes
"Jim Dodd" <bcbuilderboy@yahoo.com> wrote in message news:4151d06a$1@newsgroups.borland.com... > I never get any value for Flags in the TIdMessage object Nor should you. TIdMessage does not use that property at all. That is for user-defined values for your own code to use as needed. > I'm checking for the value mfRecent to see if a message > has recently arrived but Flags is always 0 As it should be. > even though I've sent a recent message to the mailbox. That is not how the Flags property works. > No matter how many times I use this, I always get the same > number for iMsg (the result of CheckMessages()) Correct. CheckMessages() returns how many total messages are stored on the server, not how many messages have been received since the last time CheckMessages() was called. The messages remain on the server until you delete them. > and a value of 0 for NewMsgCount (because idm->Flags is always = 0) As you should. > if( idm->Flags.Contains(mfRecent) ) > NewMsgCount++; If you are not going to download and delete the messages, then the best way to check for new messages is probably to keep a running list of all of the known message's IDs. Then each time you run the loop, you can check to see if any new IDs have appeared on the server. Gambit
Technical Details
Message-ID:
<4151dd11$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4151d06a$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6a75ae9b12954a47 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <4151d06a$1@newsgroups.borland.com> Subject: Re: Get list of new messages in POP3 Date: Wed, 22 Sep 2004 13:14:55 -0700 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4151dd11$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1095884049 68.69.17.41 (22 Sep 2004 13:14:09 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail