|
|
|
Emails after clicking on check box [message #403875 is a reply to message #403607] |
Tue, 19 May 2009 05:37 |
|
Can anybody tell me how i can send emails from forms 6i after clicking on check box to which user the email needs to send and a text box for user enter any message if he wants to send.Please give me any sample form so that i can manipulate according to me.
|
|
|
|
|
|
Re: Sending mail from form (split from Text Moving on the Form) [message #403927 is a reply to message #403917] |
Tue, 19 May 2009 10:01 |
klat
Messages: 87 Registered: May 2009 Location: Mumbai
|
Member |
|
|
Try this code..
PROCEDURE Send_Outlook_Mail (
p_recipient IN varchar2,
p_subject IN varchar2,
p_body IN varchar2,
p_attachment IN varchar2
)IS
happlication OLEOBJ;
hmailitem OLEOBJ;
hrecipients OLEOBJ;
hrecipient OLEOBJ;
hattachments OLEOBJ;
hattachment OLEOBJ;
vEmailAddStr varchar2(32500) := p_recipient;
vEmailAddr varchar2(200);
isComa number (3):= 0;
BEGIN
Loop
isComa := instr(vEmailAddStr,',');
if isComa = 0 then
isComa := instr(vEmailAddStr,';');
if isComa = 0 then
vEmailAddr := vEmailAddStr;
vEmailAddStr := null;
else
vEmailAddr := substr(vEmailAddStr,1,instr(vEmailAddStr,';')-1);
vEmailAddStr := substr(vEmailAddStr,instr(vEmailAddStr,';')+1);
end if;
else
vEmailAddr := substr(vEmailAddStr,1,instr(vEmailAddStr,',')-1);
vEmailAddStr := substr(vEmailAddStr,instr(vEmailAddStr,',')+1);
end if;
hApplication := CREATE_OLEOBJ('Outlook.Application',TRUE);
INIT_OLEARGS(1);
ADD_OLEARG(0);
hMailItem := CALL_OLE_OBJ(hApplication,GET_OLE_MEMBERID(hApplication,'CreateItem'));
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'Subject'),p_subject) ;
SET_OLE(hMailItem,GET_OLE_MEMBERID(hMailItem,'Body'),p_body);
hRecipients := GET_OLE_OBJ(hMailItem,GET_OLE_MEMBERID(hMailItem,'Recipients'));
INIT_OLEARGS(1);
ADD_OLEARG(vEmailAddr);
hRecipient := CALL_OLE_OBJ(hRecipients,GET_OLE_MEMBERID(hRecipients,'Add'));
SET_OLE(hRecipient, GET_OLE_MEMBERID(hRecipient,'Type'),1);
INIT_OLEARGS(0);
CALL_OLE( hMailItem,GET_OLE_MEMBERID(hMailItem,'Save'));
INIT_OLEARGS(0);
CALL_OLE(hMailItem, GET_OLE_MEMBERID(hMailItem,'Send'));
if isComa = 0 then
exit;
end if;
end loop;
END;
|
|
|
|
|
|