Re: Seding mail forms using outlook

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 10 Jan 2003 08:21:39 -0800
Message-ID: <3E1EF313.FC08B2DA_at_exesolutions.com>


rameshk wrote:

> Hi ,
> My application has to send simple mail using forms, i had written code
> for that. Below is code for sending mail.
> Its working fine if i am using client-server mode, but in 3-tier mode
> mail not sent instead application became busy indefinitely.
> Because in application server where forms installed, outlook express not
> installed.
> Is it possible to look up the outlook application sitting at the client
> machine from where the brower accessing the application.
> Need this help urgently. Pls.
>
> Declare
> sender varchar2(75);
> recipient varchar2(75);
> mail_body varchar2(200);
> emp_name varchar2(100);
> subject varchar2(100);
> objOutlook OLE2.OBJ_TYPE;
> objMail OLE2.OBJ_TYPE;
> objArg OLE2.LIST_TYPE;
> Begin
> subject := 'Leave application pending.. !';
> mail_body := emp_name||' has applied for leave. Waiting for your
> approval !';
>
> objOutlook := OLE2.CREATE_OBJ('Outlook.Application');
> objarg := OLE2.CREATE_ARGLIST;
> OLE2.ADD_ARG(objarg,0);
> objMail := OLE2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
> OLE2.DESTROY_ARGLIST(objarg);
>
> -------- OLE2.SET_PROPERTY(objmail,'From',sender);
> OLE2.SET_PROPERTY(objmail,'To',recipient);
> OLE2.SET_PROPERTY(objmail,'Subject',SUBJECT);
> OLE2.SET_PROPERTY(objmail,'Body',mail_body);
>
> OLE2.INVOKE(objmail,'Send');
> OLE2.INVOKE(objmail,'Display');
> OLE2.RELEASE_OBJ(objmail);
> OLE2.RELEASE_OBJ(objOutlook);
> End;
>
> Ramesh
>
> --
> Ramesh
>
> Posted via http://dbforums.com

Why are you writing this in Forms? Pass your strings to a procedure or package in the database and use UTL_SMTP.

Daniel Morgan Received on Fri Jan 10 2003 - 17:21:39 CET

Original text of this message