I am trying to iterate over my email box and find an email with a specific subject. I am using:
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case,
# the inbox. You can change that number to reference
# any other folder
messages = inbox.Items
message = messages.GetLast()
print(message)
body_content = message.body
print body_content
Does anyone know where I can find documentation for this. I would like to use a GetAll() function then filter by subject, or a getSubject() function, but I can't find documentation on this at all. Any help would be great.