Sending a mail using lotus notes from oracle forms

From: Manikandan <member_at_dbfoums.com>
Date: Wed, 28 Aug 2002 09:02:17 +0000
Message-ID: <1747302.1030525337_at_dbforums.com>


Hi,
I need to send an automatic mail whenever a data in a table is updated. In the mail i should attach a
1)Word document which describes about the changes made in the table. 2)Excel spreadsheet containing the changes.

This mail should be sent to multiple recipients.The problem is the mail should be sent from lotus notes Email Id. I have code for sending a mail with attachment but using Microsoft Outlook by using OLE2.

This is my code:(It uses MS Outlook)
PROCEDURE email
(v_to in varchar2,

v_cc in varchar2,
v_bcc in varchar2,
v_body in varchar2,
v_subject in varchar2,
v_attach in varchar2)

IS

OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE; -- documents collection Folders OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
MailItem2 OLE2.OBJ_TYPE;
OLEPARAM ole2.list_type;
Send OLE2.OBJ_TYPE;
Attachments OLE2.OBJ_TYPE;
Attachment_dummy OLE2.OBJ_TYPE;

BEGIN OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');

  • Create a namespace
  • Think of this as the equivalent as the Documents Collection OLEPARAM := OLE2.CREATE_ARGLIST; OLE2.ADD_ARG(OLEPARAM,'MAPI'); NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM); OLE2.DESTROY_ARGLIST( OLEPARAM );

--Create a newMail Object

OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM); OLE2.DESTROY_ARGLIST( OLEPARAM );
ole2.set_property(MailItem,'To',v_to);
ole2.set_property(MailItem,'CC',v_cc);
ole2.set_property(MailItem,'BCC',v_bcc);
ole2.set_property(MailItem,'Subject',v_subject);
ole2.set_property(MailItem,'Body',v_body);

Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
--Adding an attachment

OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,v_attach);
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM); OLE2.DESTROY_ARGLIST( OLEPARAM ); Send := OLE2.INVOKE_OBJ(Mailitem,'Send');

OLE2.RELEASE_OBJ( MailItem);
OLE2.RELEASE_OBJ( NameSpace );
OLE2.RELEASE_OBJ( OutlookApp );

Message('Mail send successfully...');

Exception
When others then
Message('Mail not send...');

END; Can any one tell me how to modify this to use Lotus notes??? Thanks

--

Posted via http://dbforums.com Received on Wed Aug 28 2002 - 11:02:17 CEST

Original text of this message