Clearly documented reading of emails functionality with python win32com outlook

For everyone wondering how to reach any default folder not just "Inbox" here's the list:

3  Deleted Items
4  Outbox
5  Sent Items
6  Inbox
9  Calendar
10 Contacts
11 Journal
12 Notes
13 Tasks
14 Drafts

There are more (Reminders, Sync errors etc.); you can get whole list with this code (inspired by John Cook's solution to Folders):

import win32com
outlook=win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
for i in range(50):
    try:
        box = outlook.GetDefaultFolder(i)
        name = box.Name
        print(i, name)
    except:
        pass

I'm not pasting the whole list here, because mine is in Polish and wouldn't be really helpful.


The visual basic for applications reference is your friend here. Try starting with this link...

Interop Outlook Mailitem Properties

For instance I can see that message will probably have additional properties than what you listed above. For example.

  • message.CC
  • message.Importance
  • message.LastModificationTime