How do I read the body of encrypted outlook mails in python

Viewed 119

I am trying to read the body of encrypted emails in outlook. Mails that are not encrypted are working fine, but all of the encrypted messaged are throwing an error.

Is there any way to read those messages?

Currently getting the body like this:

messages = inbox.Items    
for message in messages:
       print(message.body)

And the error is like this:

pywintypes.com_error: (-2147352567, 'Exception occurred.', (4096, 'Microsoft Outlook', 'Your Digital ID name cannot be found by the underlying security system.', None, 0, -2146893792), None)

I am using the pywin32 library and the win32com.client and the mails are using the standard outlook encrypt function when sending an email. When using Outlook you can decrypt the email by using a certificate on a smart card.

0 Answers
Related