Utl_smtp Package issue
ORA_AJApr 13 2009 — edited Apr 17 2009Hi
We are using Oracle 8.1.5 Database.I want to use Oracle UTL_SMTP package for sending email notifiaction from oracle.I have already executed the script utlsmtp.sql from ORAHOME\RDBMS\ADMIN folder as system user.But when i use this in my code and execute the PL/SQL procedure
It gives an errors as
ORA-04068: existing state of packages has been discarded
ORA-04067: not executed, package body "SYSTEM.UTL_SMTP" does not exist
Declare
SendorAddress Varchar2(30) := 'ajay6071@gmail.com';
ReceiverAddress varchar2(30) := 'ajay6071@gmail.com';
EmailServer varchar2(30) := '172.17.16.69';
Port number := 25;
conn system.UTL_SMTP.CONNECTION;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 4000 );
mesg_body varchar2(4000);
BEGIN
conn:= system.utl_smtp.open_connection( EmailServer, Port );
system.utl_smtp.helo( conn, EmailServer );
system.utl_smtp.mail( conn, SendorAddress);
system.utl_smtp.rcpt( conn, ReceiverAddress );
mesg:= 'Date: '||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' )|| crlf ||
'From:'||SendorAddress|| crlf ||
'Subject: Mail Through ORACLE Database' || crlf ||
'To: '||ReceiverAddress || crlf ||
'' || crlf ||' This is Mail from Oracle Database By Using UTL_SMTP Package'||crlf||'It is very easy to configure Tell me if you face any problems' ;
system.utl_smtp.data( conn, mesg );
system.utl_smtp.quit( conn );
END;
/
Please suggest me how to correct it .Or if there is any other way to send an email through oracle 8.1.5.0 then please let me know.
Thanks in Advance