email with PDF file attached automatically

To discuss Oracle Forms & Reports related technical issues.
Post Reply
Dream
Posts: 7
Joined: Tue Jun 12, 2007 3:41 am
Location: United Arab Emirates

email with PDF file attached automatically

Post by Dream »

hi there, i am new in this fourm ...

i found this fourm very useful and helpfull at the same time...i wish if i can get help in my problem

thanks alot 4 all

========================

i have 2 forms

<font color="blue">form number 1 : it has lots of records and next 2 each records there is a buttun...when user click on it...then it will take the information of that recorde as PDF file and it will open</font id="blue"> <font color="red">Form number 2</font id="red">

<font color="red">then in the form 2 there are [ To, CC,Attach, which the pdf will be in autmatically when user click on the button in form number1, subject, body]</font id="red">

<u>in form 1 i put this code when button pressed</u>

Code: Select all

begin
	v_pl_id := get_parameter_list(v_pl_name);
		if not id_null(v_pl_id)then
			destroy_parameter_list(v_pl_name);
		end if;
		v_pl_id := create_parameter_list(v_pl_name);
		add_parameter(v_pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
		lFileName := 'S:\Tara\Contract-System\rpts\contract.rpt'||:block76.contract_num||'.pdf';
		
		add_parameter(v_pl_id, 'DESNAME',TEXT_PARAMETER,lFileName);
		add_parameter(v_pl_id, 'DESTYPE',TEXT_PARAMETER,'File');
		Add_parameter(v_pl_id,' P_con',TEXT_PARAMETER,(:block76.contract_num));
		v_rep_txt := run_report_object('snd_contract',v_pl_id);
	
		:Global.attachment_name := 'S:\Tara\Contract-System\rpts\Contract.rpt'||:block76.contract_num||'.pdf';
		call_form('S:\Tara\Contract-system\outlook.fmx');
		
end;
<u>in form number 2 i have this code,,in when new form instance</u>

Code: Select all

:block13.attach := :Global.attachment_name; 

<u>and in the send button i have this code</u>

Code: Select all

Declare
	---procedure send email
	objOutlook ole2.obj_type;
	objMail ole2.obj_type;
	objARG ole2.list_type;
	attachment ole2.obj_type;
	args ole2.list_type;
	
begin
	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,'To',:TO);
	ole2.set_property(objmail,'CC',:CC);
	ole2.set_property(objmail,'Attach',:Attach);
	ole2.set_property(objmail,'Subject',:SUBJECT);
	ole2.set_property(objmail,'Body',:BODY);
	args:=ole2.create_arglist;
	
	ole2.add_arg(args,attachment);

	ole2.invoke(Attachment,'readfromfile',args);
	ole2.destroy_arglist(args);
	 
	ole2.invoke(objmail,'Send');
	
	ole2.invoke(objmail,'Display');
	
	ole2.release_obj(objmail);
	ole2.release_obj(objOutlook);
	ole2.release_obj(attachment); 
	
	Message('your mail sent successsfully');
	Message('your mail sent successsfully');
	clear_form;
	call_form('S:\Tara\Contract-system\module5.fmx');
	
	exception
	
	when others then
		message(SQLerrm);message(SQLerrm);
		
	end;

i wish if anyone provide me with help:)

thanks in advance to all:)

Dream
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

Dream
Posts: 7
Joined: Tue Jun 12, 2007 3:41 am
Location: United Arab Emirates

Post by Dream »

form 1:
where user click on the row and transfer to the another form with pdf attached

form 2 :

email form where user add address and click on send
Dream
Posts: 7
Joined: Tue Jun 12, 2007 3:41 am
Location: United Arab Emirates

Post by Dream »

hi again...

i did download the example done by Mr.Sikandar Hayat Awan

here in this link

topic.asp?TOPIC_ID=10


i did the same... like i link between 2 forms..so i get the pdf file in the attachment text in the attachments block...but it still not attching????

i think sth wrong in PDF???

hope if anyone can proivde me with help

thanks in advance!!!
Dream
Posts: 7
Joined: Tue Jun 12, 2007 3:41 am
Location: United Arab Emirates

Post by Dream »

<marquee id='marquee'>HOOOOOOOOOOORAY</marquee id='marquee'>

the problem was in this code

Code: Select all

(v_pl_id, 'DESTYPE',TEXT_PARAMETER,'File');
i did remove it and it works perfectly fine:D

<marquee id='marquee'>HOOOOOOOOOOORAY</marquee id='marquee'>

thanks 2 all:)

cya
usnpk
Posts: 2
Joined: Mon Dec 24, 2007 8:12 am
Location: Pakistan
Contact:

Post by usnpk »

hi i m usman could u plz send me this form
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests