Re: Sending a mail using lotus notes from oracle forms

From: jidrovo <member21609_at_dbforums.com>
Date: Fri, 03 Jan 2003 14:29:46 +0000
Message-ID: <2343829.1041604186_at_dbforums.com>


Forms can send a mail to lotus notes using OLE:

l_session := ole2.Create_Obj('Notes.NotesSession');

l_args := ole2.Create_Arglist;
ole2.Add_Arg(l_args, '');
ole2.Add_Arg(l_args, 'names.nsf');
l_db := ole2.Invoke_Obj(l_session, 'GetDatabase', l_args); ole2.Destroy_Arglist(l_args);

l_doc := ole2.Invoke_Obj(l_db, 'CreateDocument');

ole2.Set_Property(l_doc, 'SendTo', recipient_IN); ...
...
l_args := ole2.Create_Arglist;

ole2.Add_Arg(l_args, 0);
ole2.Invoke(l_doc, 'Send', l_args);
ole2.Destroy_Arglist(l_args);

--
--

But Forms can use COM for send email to lotus notes. I prefer to use COM because this method don't need open the lotus client.

1.-) First you need create a lotus COM session with the current user ID: l_session := ole2.Create_Obj('Lotus.NotesSession'); ole2.Invoke(l_session, 'Initialize');
Note: This method is new with Release 5.0.2b. 2.-) Next you need access your Notes databases on a specific server or   your local computer:
ole2.Add_Arg(l_args, 'your_server_name'); /* The server name an empty string means the local Domino or Notes data directory */ l_db_dir := ole2.Invoke_Obj(l_session, 'GetDbDirectory', l_args); 3.-) Opens the current user's mail database: l_notes_db := ole2.Invoke_obj(l_db_dir,'OpenMailDatabase'); 4.-) Creates the new document:
l_doc := ole2.Invoke_Obj(l_notes_db, 'CreateDocument'); 5.-) This method creates a new item and adds it to the document: ole2.Add_Arg(l_args, 'SendTo');
ole2.Add_Arg(l_args, recipient_in);
l_item := ole2.Invoke_Obj(l_doc, 'ReplaceItemValue', l_args); Notes: You can't use ole2.Set_Property(l_doc, 'SendTo', recipient_IN). 6.-) Send the document:
l_args := ole2.Create_Arglist;

ole2.Add_Arg(l_args, FALSE);
ole2.Invoke(l_doc, 'Send', l_args);
ole2.Destroy_Arglist(l_args);

--

Posted via http://dbforums.com Received on Fri Jan 03 2003 - 15:29:46 CET

Original text of this message