Professional Documents
Culture Documents
For Package Installation
For Package Installation
connect / as sysdba
@$ORACLE_HOME/rdbms/admin/utlmail.sql
@$ORACLE_HOME/rdbms/admin/prvtmail.plb
LOOP
BEGIN
UTL_FILE.get_line (file_handle, output);
-- we read the file, line by line
attachment_text := attachment_text || UTL_TCP.crlf;
--and store every line in the attachment_text variable, separated by a ?new line? character.
EXCEPTION
WHEN OTHERS
THEN
EXIT;
END;
END LOOP;
UTL_FILE.fclose (file_handle);
UTL_MAIL.send_attach_varchar2 (sender => 'rampant@rampant.cc',
recipients => v_recipients,
subject => v_sub,
MESSAGE => v_message,
attachment => attachment_text
);
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (-20001, 'Error: ' || SQLERRM);
END;