Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Searching two string at a time in the Object of emails
#3
(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 Smile

Thanks
Reply


Messages In This Thread
RE: Searching two string at a time in the Object of emails - by luigisic - 01-07-2022, 07:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)