Declare
begin
/*create the Application Instance*/
application:=ole2.create_obj('Outlook.Application');
/*Use the Add method to create a recipients Instance and add it to the
Recipients collection*/
args:=ole2.create_arglist;
ole2.add_arg(args,'david.[Email address protected]
recipient:=ole2.invoke_obj(hRecipients,'Add',args);
e
end;
#################### OTHER
##################################################################################
#
#############
D
Declare
objOutlook CLIENT_OLE2.OBJ_TYPE;
objMail CLIENT_OLE2.OBJ_TYPE;
objArg CLIENT_OLE2.LIST_TYPE;
objAttach CLIENT_OLE2.OBJ_TYPE;
B
BEGIN
objOutlook := CLIENT_OLE2.CREATE_OBJ('Outlook.Application');
-- Previous example usually used 'mapi.session' but this doesn't work correctly
--anymore.
objarg := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(objarg,0);
objarg := CLIENT_OLE2.CREATE_ARGLIST;
CLIENT_OLE2.ADD_ARG(objarg,'c:\temp\test.txt'); -- filename
CLIENT_OLE2.SET_PROPERTY(objmail,'To','Joe.Friday@ oracle.com');
CLIENT_OLE2.RELEASE_OBJ(objmail);
CLIENT_OLE2.RELEASE_OBJ(objOutlook);
C
CLIENT_OLE2.DESTROY_ARGLIST(objarg);
E
END;
############## OTHER
##################################################################################
####################
DECLARE
objOutlook client_ole2.OBJ_TYPE;
objMail client_ole2.OBJ_TYPE;
objArg client_ole2.LIST_TYPE;
v_mail_id varchar2(100);
generated_by_name varchar2(300);
var_new varchar2(1000);
v
------
NameSpace client_ole2.OBJ_TYPE; -- documents collection
Folders client_ole2.OBJ_TYPE;
MailItem client_ole2.OBJ_TYPE;
MailItem2 client_ole2.OBJ_TYPE;
Attachments client_ole2.OBJ_TYPE;
Attachment_dummy client_ole2.OBJ_TYPE;
OutlookApp client_ole2.OBJ_TYPE;
OLEPARAM client_ole2.list_type;
pl_id ParamList;
pl_name VARCHAR2(10) := 'tempdata';
application client_ole2.OBJ_TYPE;
hMailItem client_ole2.OBJ_TYPE;
args client_ole2.LIST_TYPE;
msg_attch client_ole2.OBJ_TYPE;
attachment client_ole2.OBJ_TYPE;
des VARCHAR2(80) := 'FILE_NAME';
attch VARCHAR2(80) ;
v_x boolean;
--desname varchar2(300) :=
'L:\oraclefiles\temp\'||:blk_liberty8d.line_srno||'.pdf';
v_pdf_file_name varchar2(500);
vcounter number := 0;
v
-
------
B
BEGIN
-------
-
v_pdf_file_name :='l:\oraclefiles\temp\'||:blk_liberty8d.line_srno||'.pdf';
v_x :=webutil_file.delete_file(v_pdf_file_name);
run_report_web('/secure/iso/reports/lib_mail.rdf','P_LINE_SRNO='||:BLK_LIBERTY8D
.LINE_SRNO||'&P_SITE_ID='||:BLK_LIBERTY8D.SITE_ID||'&desname='||'/nfserver/oraclef
iles/temp/'||:BLK_LIBERTY8D.LINE_SRNO||'.pdf'||'&desformat=pdf&destype=file¶mf
orm=no');
--end if;
-------
loop
v_x:=webutil_file.file_exists(v_pdf_file_name);
if v_x then
i
exit;
end if;
end loop;
e
o
objOutlook := client_ole2.CREATE_OBJ('Outlook.Application');
--------
/*OLEPARAM := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := client_ole2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
client_ole2.DESTROY_ARGLIST( OLEPARAM );*/
-
-------
objarg := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(objarg,0);
objMail := client_ole2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
c
client_ole2.DESTROY_ARGLIST(objarg);
client_ole2.SET_PROPERTY(objmail,'To',var_new||';'||'ESL-CSS@entity-
solutions.com');
client_ole2.SET_PROPERTY(objmail,'Subject','8D Approved');
client_ole2.SET_PROPERTY(objmail,'Body','8D Approved by '||:global.frm_emp_name||
chr(10)||'which was generated by '||generated_by_name||chr(10)||
' No. '||:blk_liberty8d.LINE_SRNO||chr(10)||
' Dated '||:blk_liberty8d.date_line_stop||chr(10)||
' Line '||:blk_liberty8d.product_lineno||chr(10)||
' FAILURE_STAGE '||:blk_liberty8d.failure_stage||chr(10)||
' Product '||:blk_liberty8d.part_name||chr(10)||
' Problem description '||:blk_liberty8d.problem_desc||chr(10)||
' Note:-This message was Automaticaly generated by SML ERP'||chr(10)||chr(10)||
chr(10)||
'[CONFIDENTIAL]');
------
Attachments := client_ole2.GET_OBJ_PROPERTY(objmail,'Attachments');
objarg := client_ole2.CREATE_ARGLIST;
client_ole2.ADD_ARG(objarg,v_pdf_file_name);
Attachment_dummy := client_ole2.INVOKE_OBJ(Attachments,'Add',objarg);
client_ole2.DESTROY_ARGLIST( objarg );
------
client_ole2.INVOKE(objmail,'Send');
client_ole2.INVOKE(objmail,'Display');
client_ole2.RELEASE_OBJ(objmail);
client_ole2.RELEASE_OBJ(objOutlook);
end if;
--v_x :=webutil_file.delete_file(v_pdf_file_name);
exception when others then
showalert('Microsoft Outlook is not configured or Not Accessible.Automatic Email
will not Be Generated');
END;
----------------------------------------------------------------------------------
----------------------------------