Skip to content

Python script to process emails saved with .msg file extension

Notifications You must be signed in to change notification settings

ev2900/Outlook_MSG_Parser_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 

Repository files navigation

Outlook .msg File Python Parser

map-user map-user

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

  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

About

Python script to process emails saved with .msg file extension

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages