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

This is a discussion on how to send mail to lotus notes with attachment from oracle forms within the Oracle Tools forums in Oracle Database category; 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('...

Go Back   Database Forum > Oracle Database > Oracle Tools

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-27-2006, 03:14 AM
Default how to send mail to lotus notes with attachment from oracle forms


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 11-28-2006, 10:49 AM
Default Re: how to send mail to lotus notes with attachment from oracle forms

Hi!

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

HTH
wrote in message
news:1164611629.005269.17630-at-l12g2000cwl.googlegro ups.com...
>
> 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
  #3  
Old 11-28-2006, 10:49 AM
Default Re: how to send mail to lotus notes with attachment from oracle forms

Hi!

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

HTH
wrote in message
news:1164611629.005269.17630-at-l12g2000cwl.googlegro ups.com...
>
> 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
  #4  
Old 06-21-2008, 02:34 PM
Cool Re: how to send mail to lotus notes with attachment from oracle forms

/*
here for the masses:
in complete spanglish, lotus notes 6.5.2 + forms6i (two tier) tested!
*/



PROCEDURE p_envia_mail (recipient_in IN VARCHAR2
, copy_to_in IN VARCHAR2
, blind_copy_to_in IN VARCHAR2
, subject_in IN VARCHAR2
, text_in IN VARCHAR2
, return_receipt_in IN VARCHAR2
, mood_stamp_in IN VARCHAR2
, view_icon_in IN NUMBER
, attachment_path in varchar2
) IS


l_rtf ole2.obj_type;



l_args ole2.list_type;
l_db ole2.obj_type;
l_doc ole2.obj_type;
l_return_receipt VARCHAR2(1);
l_session ole2.obj_type;

BEGIN



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');

l_args := ole2.Create_Arglist;

ole2.Add_Arg(l_args, 'Attachment');
l_rtf := ole2.Invoke_Obj(l_doc, 'CreateRichTextItem',l_args);
ole2.Destroy_Arglist(l_args);

ole2.Set_Property(l_doc, 'SendTo', recipient_IN);

IF copy_to_IN IS NOT NULL then
ole2.Set_Property(l_doc, 'CopyTo', copy_to_IN);
END IF;

IF blind_copy_to_IN IS NOT NULL then
ole2.Set_Property(l_doc, 'BlindCopyTo', blind_copy_to_IN);
END IF;

-- ''- Normal P - Personal
-- C - Confidential R - Private
-- F - Flame Q - Question
-- G - Good Job! M - Reminder
-- J - Joke T - Thank You!
IF mood_stamp_IN IS NOT NULL then
ole2.Set_Property(l_doc, 'SenderTag', mood_stamp_IN);
END IF;

IF subject_IN IS NOT NULL then
ole2.Set_Property(l_doc, 'Subject', subject_IN);
END IF;

IF text_IN IS NOT NULL then
ole2.Set_Property(l_doc, 'Body', text_IN);
END IF;

-- 1-Return Receipt 0-No Return Receipt
l_return_receipt :=
TRANSLATE(NVL(UPPER(return_receipt_IN), 'N'), ' NY', '001');
ole2.Set_Property(l_doc, 'ReturnReceipt', l_return_receipt);
IF l_return_receipt = '1' then
ole2.Set_Property(l_doc, 'DeliveryReport', 'B');
END IF;

IF view_icon_IN IS NOT NULL then
ole2.Set_Property(l_doc, '_ViewIcon', view_icon_IN);
END IF;





l_args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(l_args,1454);
OLE2.ADD_ARG(l_args,'');
OLE2.ADD_ARG(l_args,attachment_path);
ole2.Invoke(l_rtf, 'EmbedObject', l_args);
OLE2.DESTROY_ARGLIST( l_args );

l_args := ole2.Create_Arglist;

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

ole2.Destroy_Arglist(l_args);

ole2.Release_Obj(l_session);
ole2.Release_Obj(l_db);
ole2.Release_Obj(l_doc);

EXCEPTION
when others then
Message('Unable to send mail to ' || recipient_IN);
Set_Application_Property(CURSOR_STYLE, 'DEFAULT');
RAISE;
END;

/*
www.daniel.ec
*/
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:19 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.