Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SEND MAIL body html

Status
Not open for further replies.

fosa

IS-IT--Management
Mar 18, 2008
26
FR
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top