We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

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

chunky1
chunky1 asked
on
Medium Priority
1,382 Views
Last Modified: 2012-05-06
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

Comment
Watch Question

Commented:
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."

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.