Linking oracle with mail server [message #78143] |
Tue, 22 January 2002 01:19 |
Rajen
Messages: 2 Registered: January 2002
|
Junior Member |
|
|
Hi I created an application using forms 6.0 (developer/2000 package) and the function of this application is to send sms and send /receive email.I am experiencing difficulty on how to connect/link the application to a mail server or some sort.Does anyone know any code (sql pl/sql) or what.
Highly appreciated
|
|
|
Re: Linking oracle with mail server [message #78146 is a reply to message #78143] |
Tue, 22 January 2002 04:10 |
N.N.
Messages: 5 Registered: October 2001
|
Junior Member |
|
|
Here's my button to send mail. Hope it helps.
PROCEDURE email 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;
v_to varchar2(50);
v_cc varchar2(50);
v_body varchar2(250) := 'Attached is my weekly report =^-^= I have just learnt how to send an email with attachement through forms. This is so neat!';
v_bcc varchar2(50);
v_subject varchar2(50) := 'Weekly Status Report';
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 );
-- Show the new message box. - Dont do when mailing straight Through
-- MailItem2 := OLE2.INVOKE_OBJ(Mailitem,'Display');
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,'c:tempWeeklyReport.doc');
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 );
END;
|
|
|
Re: Linking oracle with mail server [message #78154 is a reply to message #78146] |
Tue, 22 January 2002 11:21 |
Srinivas Konda
Messages: 29 Registered: October 2001
|
Junior Member |
|
|
Rajan solution will work fine.
Rajan, do you have any sample code to access Outlook address book directly from forms. I could see the address book in the outlook object model but could not find any sample code.
Thanks.
|
|
|
|
|