Python Forum
Mark outlook emails as read using Python!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mark outlook emails as read using Python!
#1
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

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)
            

    
Reply


Messages In This Thread
Mark outlook emails as read using Python! - by shane88 - May-17-2021, 08:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search Outlook Inbox for set of values cubangt 1 1,064 Jun-28-2023, 09:29 PM
Last Post: cubangt
  Save image from outlook email cubangt 1 694 Jun-07-2023, 06:52 PM
Last Post: cubangt
  [Solved]Help Displaying Emails properly via Python Extra 5 1,173 Sep-28-2022, 09:28 PM
Last Post: deanhystad
  Read All Emails from Outlook and add the word counts to a DataFrame sanaman_2000 0 1,854 Sep-15-2022, 07:32 AM
Last Post: sanaman_2000
  Sending Emails on Autopilot Gyga_Hawk 3 1,683 Mar-15-2022, 08:20 AM
Last Post: Larz60+
  Doctesting a function which prints a students name along with the maximum mark scored sean1 5 2,271 Feb-01-2022, 12:20 PM
Last Post: Pedroski55
  Trying out the parsing/reading of emails from my outlook cubangt 0 6,153 Jan-12-2022, 08:59 PM
Last Post: cubangt
  Help Needed | Read Outlook email Recursively & download attachment Vinci141 1 4,075 Jan-07-2022, 07:38 PM
Last Post: cubangt
  Need Outlook send email code using python srikanthpython 3 8,217 Feb-28-2021, 01:53 PM
Last Post: asyswow64
  Something wrong with the quotation mark in dictionary definition Mark17 1 1,994 Jan-29-2021, 03:34 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020