chmod +x msg2text.py): #!/usr/bin/env python3 If you need more control over the output, below is a minimal python script based on the module above that takes the path to the outlook MSG file as the first parameter and saves the email content as plain text, and also as a RTF file (if RTF content is present, usually it is).Ĭreate the script and make it executable (e.g. Customizing the output and getting RTF content The output will be created in a subfolder generated from the email subject line.
To get plain text and the attachments from an Outlook MSG file, run it as follows: extract_msg mymessage.msg Install the extract_msg utility: pip3 install extract-msg If you have python3 installed you can use the extract_msg module which after installation will make available the extract_msg utility in your path.