Page 1 of 1

sending mail trought Lotus Notes

Posted: Thu Apr 06, 2006 10:28 am
by José Luis Sánchez
Hello:
Has anybody a sample of sending mail trought Lotus Notes ? It has to be done using OLE and I don't find how to do it.

Regards,

Posted: Thu Apr 06, 2006 10:41 am
by Antonio Linares
Jose Luis,

Do you have Lotus Notes installed on your computer ?

Posted: Thu Apr 06, 2006 10:50 am
by José Luis Sánchez
Yes, I've Notes.

This is a sample with VB:

Set session = CreateObject("Notes.NotesSession")
Set db = session.GetDatabase("", "")
Set doc = db.CreateDocument()

doc.Form = "Main Topic"
doc.Subject = Form1.Text3.Text
doc.Body = Form1.Text2.Text
Call doc.Save(True, False)

Regards,

Posted: Thu Apr 06, 2006 10:57 am
by Antonio Linares
Jose Luis,

Ok, have you tried the same logic with xharbour TOleAuto ?

Posted: Thu Apr 06, 2006 11:24 am
by José Luis Sánchez
Yes, this is the code:

oNotesSession := CreateObject( "Notes.Notessession" )
oNotesDb := oNotesSession:GetDatabase( "","" )
oNotesDb:Invoke("CreateDocument")

but I get the error that I've posted in the spanish forum.

Regards,

Posted: Fri Apr 07, 2006 7:13 pm
by James Bott
Jose,

I believe Lotus Notes supports MAPI. Have you tried it?

James

Posted: Fri Apr 07, 2006 11:17 pm
by Antonio Linares
Jose Luis,

Prueba lo siguiente:

MsgInfo( oNotesSession:hObj )
oNotesDb := OleInvoke( oNotesSession:hObj, "GetDatabase", "", "" )
MsgInfo( oNotesDb )

y dinos que valores te aparecen.

Posted: Mon Apr 10, 2006 10:06 am
by José Luis Sánchez
Antonio:
Los dos mensajes me devuelven valores númericos de 7 digitos y no me dan error.

Saludos,

Posted: Mon Apr 10, 2006 10:29 am
by Antonio Linares
Jose Luis,

Intenta ahora esto:

OleInvoke( oNotesDb, "CreateDocument" )