Skip to Main Content

SQL & PL/SQL

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!

send mail from DB. ACL error.

VIRUSep 12 2011 — edited Sep 12 2011
Hello,
I am using ORACLE DB 11g R2 & RHEL 5. I have made a procedure which will send mail to my email id from DB. I am not able to execute this procedure. I face the following error : -

begin send_mail_from_db; end;
 
ORA-29277: invalid SMTP operation
ORA-06512: at "SYS.UTL_SMTP", line 80
ORA-06512: at "SYS.UTL_SMTP", line 541
ORA-06512: at "SCOTT.SEND_MAIL", line 217
ORA-06512: at "SCOTT.SEND_MAIL", line 462
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SCOTT.SEND_MAIL_FROM_APEX", line 9
ORA-06512: at line 2
 
then i created the ACL using the following code : - ( from the scott user )
begin
  dbms_network_acl_admin.create_acl (
    acl         => 'scott_acl.xml',
    description => 'HTTP Access',
    principal   => 'SCOTT',
    is_grant    => TRUE,
    privilege   => 'connect',
    start_date  => null,
    end_date    => null
  );
 
 dbms_network_acl_admin.add_privilege (
    acl        => 'scott_acl.xml',
    principal  => 'SCOTT',
    is_grant   => TRUE,
    privilege  => 'connect',
    start_date => null,
    end_date   => null
  );
  
    dbms_network_acl_admin.assign_acl (
    acl        => 'scott_acl.xml',
    host       => 'internal-mail-router.abc.com',
    lower_port => 80,
    upper_port => 80
  );
  
 

  commit;
end;
still i face the same error while executing the procedure and i am not able to send mails from db.

I have a few queries here: -
1) What should be the "host" name :- db server name or mail server name ??? I have used the mail server name.
2) Am i lacking any privileges?
3) what principal should i put while creating and giving privileges to ACL.

Please provide a suitable solution so that i should be able to send mails. If you want some more info let me know.

Thanks in advance.

Edited by: VIRU on Sep 12, 2011 3:22 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2011
Added on Sep 12 2011
5 comments
1,496 views