dbTalk Databases Forums  

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

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss how to send mail to lotus notes with attachment from oracle forms in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sanjeev.sadh@gmail.com
 
Posts: n/a

Default how to send mail to lotus notes with attachment from oracle forms - 11-27-2006 , 01:13 AM







Hi,
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);


Reply With Quote
  #2  
Old   
Jack
 
Posts: n/a

Default Re: how to send mail to lotus notes with attachment from oracle forms - 11-28-2006 , 08:48 AM






Hi!

begin_attachment(
conn => conn,
mime_type => 'application/pdf',
inline => TRUE,
filename => filename ,
transfer_enc => 'base64');

HTH
<sanjeev.sadh (AT) gmail (DOT) com> wrote

Quote:
Hi,
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);




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.