UTL_MAIL does not work in the procedure.

Hello guys, I have given privilege to run on my user and executed UTL_MAIL package the following

exec utl_mail.send (sender = > ' < user_id1 > @ < domain_name > .com ', recipients = > ' < user_id2 > @ < domain_name > .com ', subject = > 'Test eMail', message = > 'blah');

the utl_mail perform very well.

But now I want to put the utl_mail package in a procedure.

CREATE OR REPLACE PROCEDURE test_email AS

BEGIN

UTL_MAIL. SEND (sender = > ' < user_id1 > @ < domain_name > .com ',)

recipients = > ' < user_id2 > @ < domain_name > .com '.

subject = > 'Test eMail ',.

message = > "blah");

END;

now, when I run the procedure "run the test_email", I get the following error.

BEGIN user_id1.test_email; END;

Error on line 1

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

ORA-06512: at "SYS." UTL_MAIL", line 654

ORA-06512: at "SYS." UTL_MAIL", line 671

ORA-06512: at "USER_ID1. TEST_EMAIL', line 3

ORA-06512: at line 1

Script done on line 10.

can someone help me on this point, which is UTL_MAIL to work when running individually and does NOT when it is used in a procedure, where mistaken?

Thank you

The procedure has worked.  to get the UTL_MAIL work with in a process, outside the grant execute on UTL_MAIL to the user, that user is referred to an ACL as follows. previously, I thought a creation of ACL is sufficient to generate emails for all users.

BEGIN
DBMS_NETWORK_ACL_ADMIN. (ADD_PRIVILEGE)
ACL-online "."
main-online "."
IS_GRANT => TRUE,
privilege of-online 'connect');
END;
/

Tags: Database

Similar Questions

  • Count variable does not work in the procedure

    I write a simple procedure in a package. Based on the number of records I'm inserting record in the other table.
    Count (fielname) alwways returns zero. But the same SQL statement works fine when I run just outside the procedure sql statement in the SQL window.

    # provider, the user name fields are varchar (20)

    NUMBER OF L_CNTSUPP;
    ---------
    SELECT count (SUPPLIERID)
    IN L_CNTSUPP
    OF TBLSEQUENCE TS, YOU TBLUSER
    WHERE ltrim (rtrim (TS. SUPPLIERID)) = ltrim (rtrim (TU.INFO_1))
    AND ltrim (rtrim (TU. USERID)) = ltrim (rtrim (L_USERID));
    Dbms_output.put_line (L_CNTSUPP);
    ---------

    Please advice.

    Hello

    Try this:

    SELECT count(*)
    INTO L_CNTSUPP
    FROM TBLSEQUENCE TS, TBLUSER TU
    WHERE ltrim(TS.SUPPLIERID) = ltrim(TU.INFO_1)
    AND ltrim(TU.USERID) = ltrim(L_USERID);
    DBMS_OUTPUT.put_line(L_CNTSUPP);
    

    Number of points: you don't need a RTRIM when you use VARCHAR, it automatically is RTRIMmed, but you should use VARCHAR2 in Oracle - VARCHAR is for Oracle internal use and may change without notice. You need only LTRIM if you have spaces to the left of the data.

  • Update does not work in the procedure

    Hello

    I have a simple procedure that contains an update statement... I use a variable to update a column in a table...

    For some reason, the content of the field is not being updated!

    [code]

    CREATE OR REPLACE PROCEDURE Test_Update IS

    BEGIN

    DECLARE

    vessel_sub_type_txt varchar2 (150);

    BEGIN

    vessel_sub_type_txt: = 'Charter Tours, sport fishing;

    UPDATE VESSEL_TMP V

    SET V.VESSEL_SUB_TYPE_TXT = vessel_sub_type_txt,

    V.DATE_MOD_BY_DTE = SYSDATE,

    V.A01_USER_MOD_BY_ID = "lafontm".

    WHERE V.VESSEL_ID = 29933;

    COMMIT;

    END;

    END Test_Update;

    [/ code]

    No clue as to why it doesn't work?

    Thank you

    Marc L

    DOH, there you go.

    Change the name of your variable. Oracle is the thought that vessel_sub_type_txt is the name of the column, so it's just update to himself.

    Use a different variable name.

    J

  • Nokia PC Suite does not work on the Satellite A100-234

    I installed the Nokia PC Suite in my laptop (Satellite A100-234) Unfortunately his does not work. The same cable and Mobile is to connect with other computers.

    Please send your valuable suggestions.

    Hello

    Could you please be more specific?
    Did you get the error messages or something else?

    Maybe something is wrong during the installation procedure
    So I recommend removing this Nokia program and try to install it again.

    In addition, I would recommend checking the PC Suite FAQ on the website

  • I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    Hi yjain51,

    I understand you had some problems recently with getting Touch ID to work reliably on your iPhone 5s. I know that it is a feature of great security for your iPhone, so I'm happy to help you.

    When you use Touch ID, make sure that your hands are free of any dirt or moisture so that fingerprints can be read clearly. This article explains further:

    Use the ID Touch on iPhone and iPad - Apple Support

    Thank you for using communities Support from Apple. See you soon!

  • Download Nikon D90 photos via a cable of Photos does not work. The picture freezes and does not matter. Any ideas?

    Download photos of Nikon D90 Photos OS El Capitan 10.11.16 cable does not work. The picture freezes and does not matter. Any ideas?

    Try with Capture of Image (in your applications folder)

    LN

  • My apple pencil does not work after the 9.3.4 update.

    My apple pencil does not work after the 9.3.4 update. I tried to restart but still does not work. Tried to forget the device and whenever I connect the pencil to the ipad pro, it is said that it does not recognize the cable / device. Help please.

    < re-titled by host >

    Greetings RechargeableJam,

    Welcome to the communities of Apple Support!

    I see that your Apple pencil does not work after update to iOS 9.3.4. I guess it's about to have a problem with something that worked with the previous version of the iOS software. I'm happy to help you to help you find the best resolution.

    First of all, let's close open applications on your iPad Pro. This can ensure that there is nothing running in the background that is causing a conflict. The following article will help you:

    Force a nearby application on your iPhone, iPad or iPod touch

    Then connect the pencil of Apple and see if it is recognized for the time being. If you don't see the Pair button, wait a minute while your Apple pencil costs. Then disconnect your Apple pencil, Plug and back on hold until you see the button in hand.

    Best regards.

  • AutoComplete does not work on the address field.

    AutoComplete does not work on the address field. This means that the completed form is missing from the address. What is special about the address field and why doesn't autocomplete work? I have NOT opted for "don't follow it.

    http://www.thepetitionsite.com/TakeAction/918/708/047/

    Hi robmm76. I looked at the link you provided. It seems that the reason why AutoFill does not work for the address field is because of the way this field has been programmed on the site. It has been programmed to make type you part of your address and click on the right pair and it would then fill in city, State and zip code. If this field is just a special case.

    I hope this information answers your question. If you need more information or help please do not hesitate to reply to this reply.

  • Acorn TV does not work on the new Apple TV

    So disappointed that the Acorn TV app does not work with the new Apple TV we just bought. We have subscribed on iTunes and nothing happens when you try to activate the software. We can look good on the MacBook, iPad and iPhone. Verified the purchase on iTunes account and that's fine. Contact Acorn and say it is a matter of Apple.

    Strange that I have to use Chrome to even write this question. Safari and hers do not work with the Support pages. I'll send in the comments.

    I'm resetting Apple TV now. We have been with the Apple TV since version 1. I hope that we can make this work!

    How would work appletv mount 1 app on the job?

    each app to live their own lives the appletv core do not even know what applications do they just

    Use the ios network to get their content

  • Shortcut Ctrl C does not work in the main window of Firefox

    I use Firefox version 38.0.5, Windows 7
    Since the update Ctrl + C shortcut does not work in the main window of Firefox. (I can't copy text from any website using Ctrl + C).

    Click right and using the copy in the menu works perfectly. CTRL V and Ctrl X work fine without problem.

    Ctrl C works fine when copying text from the address bar and search bar, I just can't copy anything from anything in the main window of firefox.
    

    I tried to run Firefox in safe mode, I have also reset firefox and a virus scanner, but nothing has solved the problem.

    If anyone has any suggestions, that would be great. Thank you

    See:

    • bug 1173979 - copy Ctrl + C is broken in the last Irish FF 38.0.5

    Please, do not comment in bug reports
    https://Bugzilla.Mozilla.org/page.cgi?id=etiquette.html

  • Search Safari 9.1.1 does not work in the url field. Tabs are not securities.

    After I instaled 9.1.1 safari search option does not work since the URL field and tabs is not titles. IOS 10.11.5 macbook pro late 2011.

    Restart your Mac while holding down the SHIFT key. Secure boot is slow, so give it time to start your Mac completely and then restart normally.

  • can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    can't connect to my home internet income james ashley forgot it the link password does not work and the password I was given does not fit into the password box

    Are you sure that you do not have to register on this site through the usual way and what you should be used elsewhere on the site?

    Have you tried to contact them to help this topic or to check if they have a FAQ on this subject?

    I found this in another thread that you created [*]:

    I'm not sure do I bought a home income internet james ashley program and I copied the login info I was given and the password does not fit into the window of password and I forgot the link password does not work I sent emails, but do not receive an answer im don't know what to do is anyway you can help me to recover my info or help me change the password?

    I assume that you have downloaded and installed this program and need to use this password in this program or only you can use these data to download the program from the site james ashley?

  • SQLite Manager does not work with the v11. Until make you it easier to go back to older versions or newer versions stop, breaking most of the modules I won't use Firefox

    SQLite Manager does not work with the v11. Until that make it easier to return to older versions or newer versions stop, breaking most of the modules I use FirefoxHow to come back at 10 Firefox?

    Update Firefox 23.0 which published yesterday afternoon.

  • Safari does not work in the iOS on ipad 2 and 4 9.3.1

    Safari does not work in the iOS on ipad 2 and 4 9.3.1

    Assuming that other internet such as connectivity features

    E-mail

    YouTube app

    Music streaming

    works very well

    Settings - Safari - erase data and history of the site

    Do a forced reboot - after all open applications using the app Chooser - invoked by fast double pressing the home button and drag upwards on each app until it disappears from the screen.

    Meet the sleep/wake and home buttons down until you see the logo  - then release and allow normal start upward

  • The new tab (+) does not work, or the file/new tab feature

    The new tab (+) does not work. The function of the file/new tab does no more work. Both had worked correctly until noon today. I haven't added any software, plug-ins or extensions today, I do not have the Ask toolbar. I tried several of the suggestions made on this site, nothing helps.

    This problem may be caused by an extension that does not work in the current version of Firefox.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do not click on the reset button on the start safe mode window or make changes.

Maybe you are looking for