hi all,
I want to send mail with demomail from orale SAMPLE
I want to send an html file in the body
like this
DECLARE
conn utl_smtp.connection;
vInHandle utl_file.file_type;
vNewLine VARCHAR2(25000);
message varchar2(32000);
BEGIN
vInHandle := utl_file.fopen('MY_DIRECTORY', 'My_PAGE.html', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
EXCEPTION
WHEN no_data_found then utl_file.fclose(vInHandle);
message := message || vnewline ||UTL_TCP.crlf;
END;
END LOOP;
conn := demo_mail.begin_mail(
sender => 'Me <SENDER@server.com>',
recipients => 'RECIPIENT@server.com>',
subject => 'HTML E-mail Test',
mime_type => 'text/html');
demo_mail.write_text(
conn => conn,
message => message);
demo_mail.end_mail( conn => conn );
-- debug(vNewLine);
END;
/
But I have this message
ERROR at line 1:
ORA-29282: invalid file ID
ORA-06512: at "SYS.UTL_FILE", line 645
ORA-06512: at line 10
how to do this
I want to send mail with demomail from orale SAMPLE
I want to send an html file in the body
like this
DECLARE
conn utl_smtp.connection;
vInHandle utl_file.file_type;
vNewLine VARCHAR2(25000);
message varchar2(32000);
BEGIN
vInHandle := utl_file.fopen('MY_DIRECTORY', 'My_PAGE.html', 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
EXCEPTION
WHEN no_data_found then utl_file.fclose(vInHandle);
message := message || vnewline ||UTL_TCP.crlf;
END;
END LOOP;
conn := demo_mail.begin_mail(
sender => 'Me <SENDER@server.com>',
recipients => 'RECIPIENT@server.com>',
subject => 'HTML E-mail Test',
mime_type => 'text/html');
demo_mail.write_text(
conn => conn,
message => message);
demo_mail.end_mail( conn => conn );
-- debug(vNewLine);
END;
/
But I have this message
ERROR at line 1:
ORA-29282: invalid file ID
ORA-06512: at "SYS.UTL_FILE", line 645
ORA-06512: at line 10
how to do this