[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1302
  • Last Modified:

Tidmessage - How can I tell if a message has been read from the POP3 server?

Hello All,
I am in need of some help with my Indy coments.
I have a pop3 mail server that is accessed by multiple machines, therefore one of the machines leaves the messages in the mailbox once they have been read.
I am trying to determine if a message has been already read on the server.

I may be going about it the wrong way but I am retreiving the message and trying to use the message flags as below, however it does not detect any new messages,
Can someone help me here please?

Many thanks.

Paul.
var
  Messages:Tstrings;
  Mcount:integer;
  Msg: TIdMessage;
  Newmessage:boolean;
begin
    Newmessage:=false;
    Messages:=Tstringlist.Create;
    Messages.Clear;
    pop3.Connect;
    Mcount:=pop3.CheckMessages;
    If MCount>0 then
    for mcount:=0 to Messages.Count-1 do
    begin
      msg:=tidmessage.Create(application);
      POP3.Retrieve(mcount+1, Msg);
      If mfSeen in msg.Flags then
        Newmessage:=true;
      msg.Free;
    end; // message lop
    pop3.Disconnect;
  If newmessage then
    showmessage('New messages')
  else
    showmessage('No Messages');
  messages.Free;
end;

Open in new window

0
chunky1
Asked:
chunky1
1 Solution
 
xr1140Commented:
i think that indy provide those flags so you can manage messages state on you application (eg. email client)

please have a look at the second post from the following link :

http://delphi.newswhat.com/geoxml/forumhistorythread?groupname=borland.public.delphi.internet.winsock&messageid=3ec4ffed@newsgroups.borland.com

"POP3 does not record, or process, the states for e-mail: Its just there.
IMAP on the other hand allows you to use flags to specify new, read,
deleted, etc messages."
0
 
chunky1Author Commented:
This is not really the solution I was after but apon investigation it appears that pop3 is not capable of ot.
Thanks xr1140 for yur input, I have given you the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now