Home » Developer & Programmer » Forms » Linking oracle with mail server
Linking oracle with mail server [message #78143] Tue, 22 January 2002 01:19 Go to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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.
Re: Linking oracle with mail server KIND ATTN: N. N [message #78724 is a reply to message #78146] Tue, 12 March 2002 22:50 Go to previous messageGo to next message
Sandeep Pathak
Messages: 3
Registered: March 2002
Junior Member
Hi,

Friend, I have copied the code above in my form. I am using forms 6i.

Code is getting executed, but I am not getting mails. The to variable of the code, I have changed to sandeepppathak@yahoo.com.

Can u please help me out of this.

This is sending, How to receive mails. I want to display the list of mails received in my Form.

Sandeep
Re: Linking oracle with mail server [message #79169 is a reply to message #78146] Wed, 08 May 2002 11:36 Go to previous message
Lig
Messages: 1
Registered: May 2002
Junior Member
teste
Previous Topic: "Do you want to save the changes" alert
Next Topic: Forms 2 & 3
Goto Forum:
  


Current Time: Sat Aug 08 19:24:57 CDT 2020