Home » Developer & Programmer » Forms » Parameter for get read receipt/delivery send mail from OutlookApp OLE2.OBJ_TYPE (Forms 4.5 send mail from OutlookApp OLE2.OBJ_TYPE; )
icon1.gif  Parameter for get read receipt/delivery send mail from OutlookApp OLE2.OBJ_TYPE [message #553695] Tue, 08 May 2012 01:02 Go to next message
onkar07
Messages: 7
Registered: August 2009
Location: Navi Mumbai
Junior Member
hi all ,
i am using below code to send mail from my Forms 4.5 using below given parameters it will works fine atttache text file and send mail to perticular customer but anybody can guide me how can i get the read receipt and delivery notification for sending mail .
is there any parameter for get read receipt and delivery notification for sending mail .
Thanks
Regards
Onkar
DECLARE
   pl_id       ParamList;
   Report_nm   VARCHAR2 (50);
BEGIN
   pl_id := CREATE_PARAMETER_LIST ('tmpdata');

   IF :Repdest = 'File'
   THEN
      ADD_PARAMETER (pl_id,
                     'DESNAME',
                     TEXT_PARAMETER,
                     :CTRL.File_nm);
   END IF;

   ADD_PARAMETER (pl_id,
                  'from_date',
                  Text_PARAMETER,
                  :CTRL.frdate);
   ADD_PARAMETER (pl_id,
                  'to_date',
                  Text_PARAMETER,
                  :CTRL.todate);
   ADD_PARAMETER (pl_id,
                  'spcode',
                  Text_PARAMETER,
                  :PM_PARTYcode);
   -- Add_Parameter(pl_id,'DESTYPE',Text_PARAMETER,'Screen');
   ADD_PARAMETER (pl_id,
                  'DESTYPE',
                  TEXT_PARAMETER,
                  'file');
   --Add_Parameter(pl_id,'desname',Text_PARAMETER,'File Location'||Customer Code||'('||to_char(to_date(:frdate,'DD-MON-YYYY'))||'To'||to_char(to_date(:todate,'DD-MON-YYYY'))||')'||'.txt');
   ADD_PARAMETER (pl_id,
                  'PARAMFORM',
                  Text_PARAMETER,
                  'No');
   Report_nm := 'R:\SPACCOUNTING\sp_ledger_print';
   RUN_PRODUCT (REPORTS,
                Report_nm,
                SYNCHRONOUS,
                RUNTIME,
                FILESYSTEM,
                pl_id,
                NULL);

   IF NOT ID_NULL (pl_id)
   THEN
      DESTROY_PARAMETER_LIST (pl_id);
   END IF;
END;

DECLARE
   OutlookApp         OLE2.OBJ_TYPE;
   NameSpace          OLE2.OBJ_TYPE;
   MailItem           OLE2.OBJ_TYPE;
   OLEPARAM           OLE2.LIST_TYPE;
   Send               OLE2.OBJ_TYPE;
   Attachments        OLE2.OBJ_TYPE;
   Attachment_dummy   OLE2.OBJ_TYPE;
   var1               VARCHAR2 (32767);
   sp_name            VARCHAR2 (100);
   p_mail             VARCHAR2 (100);
BEGIN
   BEGIN
      SELECT pm_party_name
        INTO sp_name
        FROM party_master
       WHERE pm_partycode = :party_master.pm_partycode;
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         sp_name := NULL;
   END;

   BEGIN
      SELECT pm_party_name, pm_email
        INTO sp_name, p_mail
        FROM party_master
       WHERE pm_partycode = :party_master.pm_partycode;

      MESSAGE (p_mail);
      MESSAGE (' ');
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         sp_name := NULL;
   END;

   --assign a value to the variable from the Oracle Form
   -- var1 := :BLOCK5.txt5;
   --but for testing, populate the variable 'by hand'
   var1 := 'Required Text ';
   OutlookApp := OLE2.CREATE_OBJ ('Outlook.Application');
   OLEPARAM := OLE2.CREATE_ARGLIST;
   OLE2.ADD_ARG (OLEPARAM, 'MAPI');
   NameSpace := OLE2.INVOKE_OBJ (OutlookApp, 'GetNameSpace', OLEPARAM);
   OLE2.DESTROY_ARGLIST (OLEPARAM);
   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', p_mail);
   OLE2.
    SET_PROPERTY (
      MailItem,
      'Subject',
         sp_name
      || ' '
      || 'SP Ledger'
      || '('
      || TO_CHAR (TO_DATE (:frdate, 'DD-MON-YYYY'))
      || 'To'
      || TO_CHAR (TO_DATE (:todate, 'DD-MON-YYYY'))
      || ')');
   OLE2.SET_PROPERTY (MailItem, 'Body', var1);
   --add an attachment
   Attachments := OLE2.GET_OBJ_PROPERTY (MailItem, 'Attachments');
   OLEPARAM := OLE2.CREATE_ARGLIST;
   OLE2.
    ADD_ARG (
      OLEPARAM,
         'File Location'
      || :party_master.pm_partycode
      || '('
      || TO_CHAR (TO_DATE (:frdate, 'DD-MON-YYYY'))
      || 'To'
      || TO_CHAR (TO_DATE (:todate, 'DD-MON-YYYY'))
      || ' )'
      || '.txt');
   Attachment_dummy := OLE2.INVOKE_OBJ (Attachments, 'add', OLEPARAM);
   OLE2.DESTROY_ARGLIST (OLEPARAM);
   Send := OLE2.INVOKE_OBJ (MailItem, 'Send');
   --destroy objects
   OLE2.RELEASE_OBJ (MailItem);
   OLE2.RELEASE_OBJ (NameSpace);
   OLE2.RELEASE_OBJ (OutlookApp);
END;


[EDITED by LF: reformatted code and applied [code] tags]

[Updated on: Tue, 08 May 2012 01:22] by Moderator

Report message to a moderator

Re: Parameter for get read receipt/delivery send mail from OutlookApp OLE2.OBJ_TYPE [message #553700 is a reply to message #553695] Tue, 08 May 2012 01:24 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know the answer, sorry.

However, for the future reference: your message was difficult to read. Please, before posting your next message, read this short tutorial (won't take more than a few seconds) - it will teach you how to properly format your code and apply [code] tags which will preserve formatting.
Previous Topic: Data Export to Excel file
Next Topic: How to capture time (merged 2)
Goto Forum:
  


Current Time: Fri Jul 05 21:51:43 CDT 2024