Hello Python Community!
I'm trying to create an MD5 hash of email contents in order to be able to identify it by its contents afterwards.
Also, the code is intended to be used across multiple machines. I'm running Python 3.10.4 on two computers with pywin32 304:
machine 1:
I'm trying to create an MD5 hash of email contents in order to be able to identify it by its contents afterwards.
Also, the code is intended to be used across multiple machines. I'm running Python 3.10.4 on two computers with pywin32 304:
Output:C:\Users\thisisme1>pip show pywin32
Name: pywin32
Version: 304
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: [email protected]
License: PSF
Location: c:\users\thisisme1\appdata\local\programs\python\python310\lib\site-packages
Requires:
Required-by: jupyter-core, xlwings
When running the following code:import win32com.client outlook = win32com.client.Dispatch('Outlook.Application').GetNamespace("MAPI") messages = outlook.Folders['[email protected]'].Folders["Inbox"].Folders["Folder1"].Folders["Folder2"].Items messages_list = list(messages) print(messages_list[0].HTMLBody)On machine 1 (Windows 11), the html body of the first email will be printed. When running the same code on machine 2 (Windows 10), execution will terminate with an error:
Error:PS C:\Users\thisisme2> & C:/Users/thisisme2/AppData/Local/Programs/Python/Python310/python.exe "c:/Users/thisisme2/.../test.py"
Traceback (most recent call last):
File "c:\Users\thisisme2\...\test.py", line 7, in <module>
print(messages_list[0].HTMLBody)
File "C:\Users\thisisme2\AppData\Local\Programs\Python\Python310\lib\site-packages\win32com\client\__init__.py", line 583, in __getattr__
return self._ApplyTypes_(*args)
File "C:\Users\thisisme2\AppData\Local\Programs\Python\Python310\lib\site-packages\win32com\client\__init__.py", line 572, in _ApplyTypes_
self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
pywintypes.com_error: (-2147467260, 'Operation aborted', None, None)
"[email protected]" is one of two (machine 2) or several (machine 1) accounts configured. However, running print(messages_list[0].ReceivedTime)will work on both machines:
machine 1:
Output:PS C:\Users\thisisme1> & "C:/Users/thisisme1/AppData/Local/Programs/Python/Python310/python.exe" "c:/Users/thisisme1/.../test.py"
2022-01-28 12:02:00+00:00
machine 2:Output:PS C:\Users\thisisme2> & C:/Users/thisisme2/AppData/Local/Programs/Python/Python310/python.exe "c:/Users/thisisme2/.../test.py"
2022-04-22 10:12:03.906000+00:00
I'm out of ideas and appreciate your thoughts on this issue. Thanks a lot!