oracle - I need to direct my dbms_output in a mail -


As part of my daily work, I need it:

  • A process
  • Copy some part in the mail and send it to the business.
  • Get the output in Notepad,

If I can send mail from the database, then this will save some good time, is it possible? If so, can someone share the sample code?

If you can use Oracle 10G or later also (which is basically UTL_SMTP There is a cover on top).

  UTL_MAIL.SEND (sender => 'me @ host' recipient = & gt; you 'host @ host', topic = & gt; 'test email', message = & gt; ; 'Hello!');  

but note - from the document:

UTL_MAIL by default SMTP_OUT_SERVER configuration requirements and This includes security risks. In order to install UTL_MAIL , you should take steps to prevent the port defined by SMTP_OUT_SERVER . Flare by data transmission.

You must both install UTL_MAIL and SMTP_OUT_SERVER .

To install UTL_MAIL:

  sqlplus sys / & lt; Pwd & gt; SQL & gt; @ $ ORACLE_HOME / rdbms / admin / utlmail.sql SQL & gt; @ $ ORACLE_HOME / rdbms / admin / prvtmail.plb  

You define the SMTP_OUT_SERVER parameter in the init.ora rdbms initialization file.


Comments