Hi everyone,
I have a question I’m not able to find an answer for, so I appreciate any guidance.
I wrote some code to recursively scan through some folders to extract all Outlook email objects (extension ‘.msg’ to be precise. I am using the extract_msg module to get some attributes from the email object – sender, date, subject, and body. I would be very grateful if someone could modify my code to create a data frame using these attributes. I can think of a really inefficient way of doing this by appending to empty lists, but I’d imagine there’s a more efficient way to do this (I hope).
os.chdir(’…/Raw’)
for item in os.listdir():
msg = extract_msg.Message(item)
msg_sender = msg.sender
msg_date = msg.date
msg_subj = msg.subject
msg_message = msg.body