Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Does any one knows the Received mail date Parameter for msg Outlook file?

I am working to parse the msg (Outlook mail) file using python. I found number of attributes shown in to the code that I did so far,

I did following code for that,

import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
msg = outlook.OpenSharedItem(r"C:\test_msg.msg")
print msg.SenderName
print msg.SenderEmailAddress
print msg.SentOn
print msg.To
print msg.CC
print msg.BCC
print msg.Subject
print msg.Body

I would like to have Received data intead of SendOn date. Does any one knows, which attribute I have to use instead of msg.SendOn?

like image 243
jaymin581 Avatar asked Sep 05 '25 03:09

jaymin581


1 Answers

Use MailItem.ReceivedTime property.

like image 129
Dmitry Streblechenko Avatar answered Sep 07 '25 19:09

Dmitry Streblechenko