https://github.com/ev2900/outlook_msg_parser_python
Python script to process emails saved with .msg file extension
https://github.com/ev2900/outlook_msg_parser_python
email-parser outlook python python-example-scripts
Last synced: about 2 months ago
JSON representation
Python script to process emails saved with .msg file extension
- Host: GitHub
- URL: https://github.com/ev2900/outlook_msg_parser_python
- Owner: ev2900
- Created: 2022-11-28T14:07:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-30T01:09:08.000Z (2 months ago)
- Last Synced: 2025-04-10T03:14:01.509Z (about 2 months ago)
- Topics: email-parser, outlook, python, python-example-scripts
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Outlook .msg File Python Parser
![]()
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
- CategoriesThe python script has several dependencies. The python library is required. [win32com](https://pypi.org/project/pywin32/). The [win32com](https://pypi.org/project/pywin32/) 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
1. ```pip install win32com```
2. Set the ```folderpath``` variable in the python script to the path of a folder with the .msg file you want to process
3. Comment / uncomment the print statements you want / don't want depending on which properties of the email you want to show