Hi,
I have a requirement to email some files off the Linux server to some users. The files are the output of a SQL loader job (.log file and .BAD files).
I have a simple script that generates an email:
DECLARE
mailhost VARCHAR2(64) := 'fake.net';
sender VARCHAR2(64) := 'someone@happy-days.net';
recipient VARCHAR2(64) := 'boss@fake.net';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection (mailhost, 25);
utl_smtp.helo (mail_conn, mailhost);
utl_smtp.mail (mail_conn, sender);
utl_smtp.rcpt (mail_conn, recipient);
utl_smtp.open_data (mail_conn);
utl_smtp.write_data (mail_conn, 'Test' || chr(13));
utl_smtp.write_data (mail_conn, 'Test Attachments' || chr(13));
utl_smtp.close_data (mail_conn);
utl_smtp.quit (mail_conn);
END;
/
How can the attachments be incorporated into the above script.
The files are located on the server directory /db/home/files/sqlloader/
file names - e.g. load.BAD & load.log
Both files would need to be attached in the email. can anyone suggest how this can be achieved?
Thanks