I am currently attempting to create an email using redemption in python. I am able to complete the creation with redemption installed on my machine, but on the virtual sessions where this will be used, the redemption dll is in a different directory. Is there a way to specify the directory used in the win32com.client.Dispatch("Redemption.RDOSession") ?
search_string = 'genericemail@gmail.com'
outlook = win32com.client.gencache.EnsureDispatch("Outlook.Application")
redemption = win32com.client.Dispatch("C:\Users\CorruptionINC\Redemption\Redemption64.dll", "Redemption.RDOSession")
redemption.Logon()
draft_folder = redemption.GetDefaultFolder(16)
message = draft_folder.Items.Add()
message.save()
recipient = message.Recipients.Add(search_string)
recipient.Resolve()
I was expecting it to create an session using the directed dll, but I get the following error:
Exception has occurred: com_error
(-2147221005, 'Invalid class string', None, None)
During handling of the above exception, another exception occurred:
File "C:\Users\CorruptionINC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\OutlookContacts.py", line 28, in <module>
redemption = win32com.client.Dispatch("C:\Users\CorruptionINC\Redemption\Redemption64.dll", "Redemption.RDOSession")