Monitor outlook

Python has a win32com package, which implements a function similar to spy++ vc6.0

In addition, there is an outlook plugin for outlookspy, which is essentially spy++.
Insert picture description here
Fortunately, all variable names
are listed. At least pt_unicode is available.

accounts = win32com.client.Dispatch("Outlook.Application").Session.Accounts;

for account in accounts:
    print(account.DeliveryStore.DisplayName)
    inbox = outlook.Folders(account.DeliveryStore.DisplayName)
    folders = inbox.Folders
    for folder in folders:
        print(folder.name)
        if folder.name == "已删除邮件":
            messages = folder.Items
            a = len(messages)
            print("邮件数量")
            print(a)
            for message in messages:
                print(message.SenderEmailAddress)
                print(message.SenderName)
                print(message.ReceivedByName)

Insert picture description here
So you can get all the information you want

Insert picture description here

There will be variable changes when the point has been read or not, so you know which field it is. The basic function of spy++ but it is amazing

Guess you like

Origin blog.csdn.net/wangduqiang747/article/details/107406709