0
votes

I am trying to create a lotus notes email from python, I started with something basic and I can't connect to the lotus notes client

from win32com.client import Dispatch
import smtplib

session = Dispatch("Lotus.Notessession")

This generates this error

pywintypes.com_error: (-2147221164, 'Clase no registrada', None, None)

I tried this

from win32com.client import makepy
makepy.GenerateFromTypeLibSpec('Lotus Domino Objects')
makepy.GenerateFromTypeLibSpec('Lotus Notes Automation Classes')

Whith this result

Could not locate a type library matching 'Lotus Notes Automation Classes'
[Finished in 2.0s] 

However, from VBA I can access and create emails without problem ... Can anybody help me? THANKS

My Config:

WINDOWS 10
Python 3.7.4
Lotus Notes 9.0.1FP10 SHF252

Regards

Josse

1

1 Answers

0
votes

The Notes software is 32-bit. Is your Python environment 64-bit? If so, the Lotus classes are probably not registered for 64 bit. See my answer to this old question.

Also, there is a difference between Lotus Domino Objects, and Lotus Notes Automation Classes. The former are COM classes and are accessed via Lotus.NotesSession and can be made to work on 64-bit (mostly) if they are properly registered - but are not supported on 64-bit. The latter are OLE classes and are accessed via Notes.NotesSession, and I don't think they can be made to work on 64-bit (but I might be wrong) and are also not supported on 64-bit.