Follow these steps to install UTL_MAIL package in Oracle 11g.
- Install the UTL_MAIL script as following:
- In Windows:
Change the path below with your Oracle Home path.
sqlplus sys/[email protected] as sysdba @C:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlmail.sql @C:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\prvtmail.plb
- In Linux:
sqlplus sys/[email protected] as sysdba @$ORACLE_HOME/rdbms/admin/utlmail.sql @$ORACLE_HOME/rdbms/admin/prvtmail.plb
- Grant the privilege to all the users for UTL_MAIL package.
grant execute on utl_mail to public;
You can give a specific username instead of public. If you will not give the grant on UTL_MAIL package, then you may get the following error:
PLS-00201: identifier 'UTL_MAIL' must be declared