Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-24247: network access denied by access control list (ACL)

754491Jul 12 2010 — edited Jul 12 2010
Here is my db version..

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production


I am trying to send email through PLSQL procedure.

here is the code i am using..


CREATE OR REPLACE PROCEDURE send_mail
( sender IN VARCHAR2,
recipient IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2)
IS
mailhost VARCHAR2(30) := 99.99.999.99';
mail_conn utl_smtp.connection;

crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 1000 );
BEGIN
mail_conn := utl_smtp.open_connection(mailhost,25);
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: <'||sender||'>' || crlf ||
'Subject: '||subject || crlf ||
'To: '||recipient || crlf ||
'' || crlf || message;
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, mesg);
utl_smtp.quit(mail_conn);
END;
/

The email is successful when i create this procedure in sys schema.

I have another user which has DBA access. When i create the procedure on non-sys schema and execute this procedure, i get the below error..

SQL> execute send_mail('xx.com','xx.com','subject...','message...');
BEGIN send_mail('xx.com','xx.com','subject...','message...'); END;

ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 246
ORA-06512: at "SYS.UTL_SMTP", line 115
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "INVENT.SEND_MAIL", line 13
ORA-06512: at line 1


I granted execute privileges for UTL_TCP, UTL_SMTP

SQL> grant execute on UTL_TCP to invent;

Grant succeeded.

SQL> grant execute on UTL_SMTP to invent;

Grant succeeded.


What could be the issue here? Any help is very helpful.
This post has been answered by NS on Jul 12 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2010
Added on Jul 12 2010
5 comments
4,293 views