I have to process the content of PDF files downloaded using IMAP Client. The previous solution was to save the data to a local temporary PDF file. Is it possible to use MemoryStream or some other way to avoid creating temporary files? If so, I would like to ask for an example or some documentation.
Existing solution:
Yes, it's possible to write the attachment to a MemoryStream.
I would modify your code to look more like this: