Extracting Information from MSG files

Download and install python from https://www.python.org/downloads

open command prompt and run:

pip install https://github.com/mattgwwalker/msg-extractor/zipball/master

This will install msg-extractor python library for working with MSG files

The python script ExtractMsg.py automates the extraction of key email data (from, to, cc, date, subject, body) and the email's attachments..

https://github.com/mattgwwalker/msg-extractor/

Is done by using “Script” Package Action:

import ExtractMsg,os,etltools

msg = ExtractMsg.Message(etltools.GetVariable('<FileName>'))
etltools.SetVariable('<MessageSender>',msg.sender)
etltools.SetVariable('<MessageSentDate>',msg.date)
etltools.SetVariable('<MessageSubject>',msg.subject)
etltools.SetVariable('<MessageBody>',msg.body)

oldDir = os.getcwd()

os.chdir(etltools.GetVariable('<DirectoryName>'))

for attachment in msg.attachments: attachment.save()

os.chdir(oldDir)

Result.Value = 1

Advanced ETL Processor Professional and Enterprise Documentation
Visual Importer ETL Professional and Enterprise Documentation

For more technologies supported by our ETL Software see Advanced ETL Processor Versions and Visual Importer ETL Versions

Confused? Ask question on our ETL forum

  • knowledgebase/extracting_information_from_msg_files.txt
  • Last modified: 17/09/2018 09:45
  • by admin