While sending mail using utl_mail or utl_stmp in oracle 11g, you may get access denied error:

begin
utl_mail.send(sender => ‘admin@dbaclass.com’,
recipients => ‘admin@dbaclass.com’,
subject => ‘MAIL from ADMIn of dbaclass’,
message => ‘Do visit dbaclass’);
end;
/

*
ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at “SYS.UTL_MAIL”, line 662
ORA-06512: at “SYS.UTL_MAIL”, line 679
ORA-06512: at line 2

 

Solution:

From 11g onward, to send mail using UTL_MAIL or UTL_SMTP , ACL need to be created in the database.

Set the SMTP_OUT_SERVER parameter

Now create ACLS
Suppose the user APPUSER want to send mail from procedure.

 

Now try to send mail: