Is it possible to use Python to extract timestamps from received email? I’m using the following code but to no avail:
JavaScript
x
7
1
messages = ap.Items
2
message = messages.GetNext()
3
receipt = message.ReceivedTime.date()
4
5
for i in messages:
6
print(receipt)
7
I only get one date published repeatedly for each email. (i.e., 2021-11-22, 2021-11-22, 2021-11-22…….)
Any help will be much appreciated.
Advertisement
Answer
Well, of course – you only retrieve ReceivedTime
once:
JavaScript
1
3
1
for i in messages:
2
print(i.ReceivedTime.date())
3