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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Outlook send email code using python srikanthpython 3 1,502 Feb-28-2021, 01:53 PM
Last Post: asyswow64
  Something wrong with the quotation mark in dictionary definition Mark17 1 354 Jan-29-2021, 03:34 PM
Last Post: buran
  How to mark duplicate rows in pandas Mekala 3 655 Sep-17-2020, 11:32 PM
Last Post: scidam
  Outlook Emails & HTML Table in Message Body JoeDainton123 1 2,120 Sep-02-2020, 05:15 AM
Last Post: buran
  reading shared outlook emails zarize 0 857 Mar-03-2020, 01:47 PM
Last Post: zarize
  Help Needed | Read Outlook email Recursively & download attachment Vinci141 0 1,196 Feb-21-2020, 04:45 AM
Last Post: Vinci141
  Python Library for Reading POP Emails? bmccollum 1 1,275 Jan-06-2020, 06:37 PM
Last Post: micseydel
  Read in trades from emails semantina 2 702 Nov-06-2019, 06:12 PM
Last Post: semantina
  What is the correct syntax for list items that need to contain a quotation mark, etc? KaisoArt 7 1,288 Sep-14-2019, 05:26 AM
Last Post: buran
  Reading email messages on Outlook johnjohn 9 24,379 Apr-03-2019, 10:41 AM
Last Post: Ken2702

Forum Jump:

User Panel Messages

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