Home » SQL & PL/SQL » SQL & PL/SQL » Sending e-mail from PL/SQL with attachment files
Sending e-mail from PL/SQL with attachment files [message #43896] Wed, 01 October 2003 13:41 Go to next message
Messages: 26
Registered: June 2003
Junior Member
Hi, Oracle experts,

I have some questions for sending e-mail with attachment files.
I have read ¡°Ask Tom¡± about this topic from:


I am not Java expert and never used Java in Oracle. So I just followed step by step to download JavaMail API. But I do not have SYS userid and password and I sent that java files to our DBA and asked him to load them for me. After he told me it was ready, I copied java source ¡°mail¡± which Tom provided. My questions are:

1. How can I compile the code? After I copied the code and tried to compile it, I got error:
create or replace and compile java source named "mail"
ERROR at line 1:
ORA-29536: badly formed source: User has attempted to load a class
(mail$BLOBDataSource) into a restricted package. Permission can be granted
using dbms_java.grant_permission(<user>, LoadClassInPackage...

Is that mean DBA should grant permission to me for using java package? What is command to grant?

2. Should the attachment files must be text file? Can I attach PDF files? What¡¯s mean about dftMime = "application/octet-stream" inside java class mail code? What directory is for the attachment files? Can I put the files in my local directory or must be in database directory?

Thanks in advance

Re: Sending e-mail from PL/SQL with attachment files [message #245986 is a reply to message #43896] Tue, 19 June 2007 08:50 Go to previous message
Messages: 2
Registered: June 2007
Location: INDIA
Junior Member
Yes u can attach any type of file not only text.
other thing is that utl_mail package needs to be installed by dba then only it will work.
Previous Topic: how can i determine the size of a table?
Next Topic: Greatest column name with value
Goto Forum:

Current Time: Wed Oct 26 12:56:49 CDT 2016

Total time taken to generate the page: 0.08114 seconds