Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29762

Parse throught mails in sent items folder in a shared mailbox

$
0
0

I'm trying to parse throught sent mails in a shared mailbox. I can parse throught folder inside the mailbox, but impossible to get the mails inside the folders.

The code I use:

compteur= [i for i in range (11)] #Number of mailbox i have to work with
    for i in compteur:
        if i !=0:
            outlook = win32com.client.Dispatch("Outlook.Application")
            namespace = outlook.GetNamespace("MAPI")
            root_folder = namespace.Folders.Item(i)
            for j in root_folder.Folders: # (if i print (j), i can get the folders list of each mailbox )
                for k in root_folder.Folders.Items:
                    print(j) # i get a AttributeError: <unknown>.Items with this code.

Viewing all articles
Browse latest Browse all 29762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>