Email(s) saved with the .msg file extension are not human read-able when opened in a text editor. These files (.msg) are also difficult to process in Python using common text manipulation process ex. regular expressions. This repository has a python script that can parse all .msg files in a folder and can extract the following fields
- SenderName
- SenderEmailAddress
- SentOn
- To
- CC
- BCC
- Subject
- Body
- Categories
The python script has several dependencies. The python library is required. win32com. The win32com library is used to access Outlook.Application
requiring you to have the outlook email client installed on the windows machine you run the Python script from.
To run the python script
pip install win32com
- Set the
folderpath
variable in the python script to the path of a folder with the .msg file you want to process - Comment / uncomment the print statements you want / don't want depending on which properties of the email you want to show