'I try to connect my self to outlook with pywin32 python but i don't want to use the application

To be clear, i want to use this line of code outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") but i do not want to use the outlook application. I want to connect myself to outlook.office365.com. Not to Outlook.Application because I have to use my code on Linux and Outlook application isn't on Linux. But I still want to use win32com because he reads very clearly email.

Can someone help me ? because I don't find how to do it !



Solution 1:[1]

The line of code you are referring to is specific to the desktop edition of Outlook and Windows:

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")

You may consider using Graph API instead.

For the on-premise exchange accounts you may consider using EWS, see Explore the EWS Managed API, EWS, and web services in Exchange for more information.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Astafiev