I think what you are trying to do may be very tricky as it needs to interact with a mail server directly. Depending on how your email is handled (i.e. do you control the mail server or is it controlled by a host) and how you retrieve it (i.e do you use Outlook, Pine, Thunderbird) what file format is the file in ( PST format, maildir format, mbox format), and where the subsequent mail file is stored (local machine, server) can all determine even if it’s possible.
If you do not have control over the mail server AND you use a program like Outlook to retrieve your email, you will probably be looking at a difficult project.
IF you use a program like sendmail or qmail in an MBOX or MAILDIR format on the same server as your webserver, it may be much eaiser to deal with, but you will likely have to do a lot of parsing.
So I guess my answer is another question… A question of needing more information on how you want to proceed.