how to send mail to lotus notes with attachment from oracle forms

From: <sanjeev.sadh_at_gmail.com>
Date: 26 Nov 2006 23:13:49 -0800
Message-ID: <1164611629.005269.17630_at_l12g2000cwl.googlegroups.com>


Hi,
[Quoted] I need to send an automatic mail through lotus notes In the mail i should attach a PDF document . MY mail is generating but im unable to attached my pdf document. Pls give me solution how can i attach pdf document in my mail and it will we be attach automatically th

This mail should be sent to multiple recipients.The problem is the mail

should be sent from lotus notes Email Id.

i got this code on net for solve my problem but im unable to attach a .pdf document for send email through forms

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);
Received on Mon Nov 27 2006 - 08:13:49 CET

Original text of this message