This project is going to sound pretty stupid. Heads up. I was in a marketing class, and was doing some testing on different email addresses. At the time, we were given free versions of Microsoft Exchange, so I had that set up on a box that I ran at my house. This was before Outlook Web Access was a thing. And I wasn't using POP3 or IMAP because I had tons of addresses set up. In hindsight, I should have had them set up as aliases, but oh well.
Because I had a bunch of email addresses, but wanted to manage them in one place, I found this great method for accessing them all in one place. I would write a php script that would go into the Exchange server folder, and would pull up the files associated with each email address, and parse out the subject line, and show the subject line, with a link to view the whole email.