OK, this is less kinkier but I felt like trying the utl_smtp pkg so here's what you can do(I've used T kyte's example with a few variations here and there, for eg: with the newer version of javamail/jaf does not require unjar and rejar kind of stuff, they're are readable in the database....)
[2] then load these 2 jar files into your database(I've used 817 here) with the foll. syntax............
loadjava -u sys/pwd@dbase -o -r -v -f -noverify -synonym -g public activation.jar
do the same for the mail.jar file..
For the parameters just type loadjava to understand what they mean...
[3] then write a java source (for explanations for the syntax(es) I'd advise you to acquire the tom kyte's book, it's excellent...)
sys@NICK817.TARRY.LOCAL>
sys@NICK817.TARRY.LOCAL> set echo on
sys@NICK817.TARRY.LOCAL>
sys@NICK817.TARRY.LOCAL> create or replace function send(
2 p_from in varchar2,
3 p_to in varchar2,
4 p_cc in varchar2,
5 p_bcc in varchar2,
6 p_subject in varchar2,
7 p_body in varchar2,
8 p_smtp_host in varchar2,
9 p_attachment_data in blob,
10 p_attachment_type in varchar2,
11 p_attachment_file_name in varchar2) return number
12 as
13 language java name 'mail.send( java.lang.String,
14 java.lang.String,
15 java.lang.String,
16 java.lang.String,
17 java.lang.String,
18 java.lang.String,
19 java.lang.String,
20 oracle.sql.BLOB,
21 java.lang.String,
22 java.lang.String
23 ) return oracle.sql.NUMBER';
24 /
Function created.
[5] Grant appropriate privileges to the user using the mail to send attachements............
-------------------- you are able to execute this part of procedure -----------------
p_attachment_type => 'application/winzip',
16 p_attachment_file_name => 'OTNToolbar.zip');
-----------------------------------------------------------------------------------
In my scenario - I am not having any directory in my oracle database but i am having something like this
--------
SQL> desc quot_ole
Name Null? Type
------------------------------- -------- ----
QUOT_NUMBER VARCHAR2(30)
QUOT_OBJECT LONG RAW
-------
People save either word or pdf documents and unique quot_number like 'abc/2009' is assigned to each object inserted through FORMS 6i OLE Container
-----------------------------------------------------------------------------
How do i retrive this data for email - which is not having directory but either
mimetype=msword or mimetype=pdf and filename = as users push Word of pdf files inside.
if you can further modify this code to pull the information as per the suggested table above it will be of gr8 help for me to implement.
Otherwise i am able to receive email as per above with attachment.
Bookmarks