UTL_MAIL Attachments [message #283544] |
Tue, 27 November 2007 07:46 |
colesg
Messages: 11 Registered: October 2007 Location: London
|
Junior Member |
|
|
Hi
Has anyone managed to send an attachment via UTL_MAIL which is bigger than 32k?
I am having an issue trying to achieve this.
Can anyone point me in the right direction please.
Cheers
Gary
|
|
|
|
|
Re: UTL_MAIL Attachments [message #283579 is a reply to message #283544] |
Tue, 27 November 2007 09:12 |
colesg
Messages: 11 Registered: October 2007 Location: London
|
Junior Member |
|
|
Hi
I have managed to get files less than 32k in size to work, but cannot get anything any bigger to work using ATTACH_RAW or ATTACH_VARCHAR2
Here is what I have done.
declare
v_utl_filehandler UTL_FILE.FILE_TYPE;
v_rawfile RAW(32767);
v_size NUMBER;
v_block NUMBER;
v_boolean BOOLEAN;
v_file_dir varchar2(100);
v_file_name varchar2(100) := 'EXT_GALA_20071123105532_20071127130013.txt';
v_transfer_location varchar2(100) := 'gary.coles@ingg.com, timothy.cassidy@ingg.com';
begin
v_file_dir := 'DIR_BILLING_DATA';
v_utl_filehandler := UTL_FILE.FOPEN(v_file_dir, v_file_name, 'r');
UTL_FILE.fgetattr(v_file_dir, v_file_name, v_boolean, v_size, v_block);
UTL_FILE.get_raw(v_utl_filehandler, v_rawfile, v_size);
UTL_FILE.FCLOSE(v_utl_filehandler);
sys.utl_mail.send_attach_raw( sender => 'Legion BDS - '||ora_database_name||' <legiondw@inspiredbroadcast.net>'
, recipients => v_transfer_location
, subject => 'Legion BDS - Transfer Billing Group File'
, message => 'Dear Client'||CHR(13)||CHR(13)||
'Please find attached this periods billing file.'||CHR(13)||CHR(13)||
'If you have any issues with this billing file please contact the Legion BI Team on bi-team@inspiredbroadcast.net'||CHR(13)||CHR(13)||
'Cheers'||CHR(13)||
'BI-TEAM'||CHR(13)||CHR(13)
, attachment => v_rawfile
, att_inline => FALSE
, att_filename => v_file_name
);
end;
Cheers
Gary
|
|
|
|
|
|