How can I read "ALL" the e-mails with a specific subject line

We can use the “Get IMAP Mail Messages” but, before I filter out the specific Mails which I need, I will have to load all the mails into my list and then loop through each mail to check the Subject line. Which is very performance inefficient.

Is there any way I can read each mail and get only the specific mail and load them into my list? or go through each mail at a time and load only the required mails into my list?

Thanks in advance for your help.

Thank you for the reply. This works for outlook but not for “Get IMAP Mail Messages” right? is there any way I can use similar solution on gmail etc online IMAP based mail services?