Home » Developer & Programmer » Forms » utl_mail
utl_mail [message #436848] Tue, 29 December 2009 00:04 Go to next message
charuamit
Messages: 121
Registered: January 2009
Senior Member
hi friends

i am trying to send an email from a form using utl_mail with a pdf attachment.
1.My mail goes ,the attachment also goes but when the receiver tries to open the attachment with adobe reader it gives an error that either the mail is in an unsupported format or is not correctly decoded.I can open the pdf file individually but only when attached it does not open.

2. Other thing my cc and bcc dont work.And in the email,it displays the AR8MS...(nls_lang)?email id

the code i have used is :

declare
	m varchar2(100);
	rfile RAW (32767) := HEXTORAW('616262646566C2AA');
begin
	
	m:='leave_report_' || :HR_STAFF_LEAVE.LV_ID ||'.pdf';
	desname:='F:\ORACLE\HR_SYS\'||n||'.pdf';

utl_mail_oracle.send_attach_raw(
     sender=>[email]'wajid-nawaz@hct.edu.om'[/email],
     recipients=>[email]'charu@hct.edu.om'[/email],
     cc=>[email]'sivakumar.sadanandam@hct.edu.om'[/email],
     bcc=>[email]'charuamit@gmail.com'[/email],
     subject=>'Leave Application Report',
     message=>'Dear Sir/Madam !This is to inform you that a Leave Application is send for your approval',
     mime_type=>'text;charset=us-ascii',
     priority=>3,
     attachment=>rfile,
     ATT_INLINE => FALSE,
     att_mime_type=>'application/pdf',
     att_filename=>m);
     
     message('mail sent ');
      
exception
	when others then
	message(sqlcode || sqlerrm);
end;

please help me out.....as its very urgent

thanks for all your help in advance

charu
[EDITED by DJM: change useless 'color' garbage to 'code']

[Updated on: Tue, 05 January 2010 22:55] by Moderator

Report message to a moderator

Re: utl_mail [message #437750 is a reply to message #436848] Tue, 05 January 2010 22:57 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
What is in 'n' in the 'desname'?

David
Re: utl_mail [message #437781 is a reply to message #437750] Tue, 05 January 2010 23:59 Go to previous messageGo to next message
charuamit
Messages: 121
Registered: January 2009
Senior Member
i have attached n.pdf where n is the dynamically generated pdf report...ex...leave_report_id(where id is the paramater value)

eg if u select id=39 thn pdf generated will be leave_report_39
and it will be attached with the mail

actually i think its an issue of base64 transfer encoding

z there a way in which i can specify the transfer encoding for my attachment in my utl_mail.send_attach_raw procedure

thanks and regards.
Re: utl_mail [message #437786 is a reply to message #437781] Wed, 06 January 2010 00:17 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
No ... the leave report is in 'm'.

David
Previous Topic: How to generate .dbf (dBase iv) File through Oracle forms or PL/SQLl
Next Topic: Oracle Pop up menu issues
Goto Forum:
  


Current Time: Sun Dec 04 10:31:59 CST 2016

Total time taken to generate the page: 0.08884 seconds