We are currently automating a process where we have emails sent to a ticketing system as attachments, in .eml files. Part of the process is to check whether the sender (of the email in the file) is from a particular domain. We have it all figured out and it works (reading the eml as a txt file with ReadTextFile, and then checking the content with IsMatch).
The problem is when the email has a big attachment, it takes a lot of time to read it into a string - it can literally take minutes.
So my question would be - do you know of any simple way to read just a first x kilobytes of a file, or possibly read it line by line? I cannot seem find any good way to do this, and would rather not dig myself into building my own workaround.
I would appreciate any direction.