Good afternoon,
I've written a python code to download my email attachments. However, it currently downloads all the emails in the folder. I receive new email attachments every day, thus I just want to download the email attachments for the current day.
Current code below does work, but as mentioned, downloads all the emails in the folder.
Thanks for your help guys..
I've written a python code to download my email attachments. However, it currently downloads all the emails in the folder. I receive new email attachments every day, thus I just want to download the email attachments for the current day.
Current code below does work, but as mentioned, downloads all the emails in the folder.
Thanks for your help guys..
Code:
import win32com.client
import datetime
import os
import email
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6).Folders.Item("LGW Performance")
message = inbox.items
items = inbox.items
for item in items:
for attachment in item.Attachments:
print(attachment.FileName)
Comment