01-07-2022, 07:23 PM
(01-07-2022, 07:11 PM)rlebeau Wrote: Which I suspect is probably not what you want. You probably want something more like this instead:
- are marked as Unseen
- AND whose subject contains EITHER 'ACC: ' OR 'CON: '
Yes, You are right.
(01-07-2022, 07:11 PM)rlebeau Wrote: The SEARCH command has an OR <search-key1> <search-key2> search-key for that very purpose, so try this:
Code:SetLength(SearchInfoArray, 4);
SearchInfo.Date := 0;
SearchInfo.Size := 0;
SearchInfo.Text := '';
SearchInfo.SearchKey := skUnseen;
SearchInfoArray[0] := SearchInfo;
SearchInfo.SearchKey := skOr;
SearchInfoArray[1] := SearchInfo;
SearchInfo.SearchKey := skSubject;
SearchInfo.Text := 'ACC: ';
SearchInfoArray[2] := SearchInfo;
SearchInfo.SearchKey := skSubject;
SearchInfo.Text := 'CON: ';
SearchInfoArray[3] := SearchInfo;
if IMAP.SearchMailBox(SearchInfoArray) then
This code work as I want.
You are an irreplaceable resource
Thanks