I am using IP*Works!
V9. I try to restrict the returned emails to only the one matching a restriction using SearchMailbox. My code looks like this:
lIMap.Mailbox := 'INBOX';
lIMap.SelectMailbox;
lIMap.CheckMailbox;
lIMap.Config('FETCHAFTERSEARCH=True');
lIMap.SearchMailbox('SUBJECT Diessenhofen UNSEEN');
if (lIMap.MessageCount > 0) then
begin
...
end;
MessageCount always reflects the total number of emails instead of one (there is one match in my inbox).
The IMAP server is Kereo
Thanks to the answer of @arnt, I figured out a solution that works for me.
Yes, for every Message that corresponds to the search criteria, the event
OnMessageInfo
is fired.Since I need to go through all messages in a loop, I ended up doing this:
where MessageList is a TStringList with delimiter ',';
I can then get all messages using either
again firing the same event or loop through them using the size of the MessageList like this: