May-17-2021, 08:53 AM
Good morning,
I have created the following script, which downloads unread email attachments from my outlook account. How do I then mark them as read once its downloaded?
Thank you
I have created the following script, which downloads unread email attachments from my outlook account. How do I then mark them as read once its downloaded?
Thank you
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 for message in inbox.Items: if message.Unread == True: for attachment in message.Attachments: print(attachment.FileName) #attachment.SaveAsFile("C:\\Users\\shanen\\Desktop\\Python\\"+ attachment.FileName)