Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Attaching BLOB's to PLSQL email
Hi All,
I coded/copied some code from a book to enable the JavaAPI email capability in PL/SQL. Everything is working great and I can even attach text files to the email.
Howver, I am having issues when it comes to attaching something else, like a photo or any type of BLOB.
I do not know how to code it.....
Here is the calling routine. How do I define a BLOB and point to it on disk? This code was using a BFILE, which I know will not work......
declare
ret_code NUMBER;
l_bfile bfile := bfilename( 'FILE_DIR', 'photo.jpg' ) ;
begin
dbms_lob.fileopen(l_bfile);
ret_code := send (
p_from => 'a_at_test.com', p_to => 'b_at_test.com', p_cc => NULL, p_bcc => NULL, p_subject => 'Java mail test', p_body => 'This is only a test.', p_smtp_host => 'mail.mailserver.com', p_attachment_data => l_bfile, p_attachment_type => 'image/jpg', p_attachment_file_name => '/tmp/photo.jpg');dbms_lob.fileclose( l_bfile );
Thanks in advance.
Arthur Received on Tue Jan 11 2005 - 15:59:41 CST