Search Results command_replies




Overview

SYS.UTL_SMTP is a standard Oracle-supplied PL/SQL package that implements the client side of the Simple Mail Transfer Protocol (SMTP). Within Oracle E-Business Suite 12.1.1 and 12.2.2, the package provides the low-level protocol primitives required to open a socket connection to an SMTP relay, negotiate a session, authenticate, and transmit an RFC 822-compliant message. In the EBS architecture, UTL_SMTP is not typically called directly by business logic. Instead, it functions as the transmission engine beneath higher-level notification and workflow components, most notably DBMS_AQELM (the Advanced Queuing e-mail gateway) and DBMS_ISCHED (the internal scheduler). Because the package is owned by SYS and exposed through a PUBLIC synonym, it is available to all EBS schemas, including APPS, without additional grants. Its principal business function is to enable outbound e-mail delivery for workflow notifications, concurrent program alerts, and application-generated messages whenever the EBS instance is configured to use a direct SMTP connection rather than an external mail client.

Key Procedures and Functions

The ETRM metadata documents 34 procedures and functions within UTL_SMTP. The principal routines are organized around the SMTP conversation lifecycle:

  • OPEN_CONNECTION — establishes a TCP connection to the specified SMTP host and returns a connection handle used by all subsequent calls.
  • HELO / EHLO — send the SMTP greeting to the mail server; EHLO requests Extended SMTP capabilities.
  • STARTTLS — upgrades the plain connection to a TLS-encrypted session when the relay supports it.
  • AUTH — performs SMTP authentication against the relay.
  • COMMAND / COMMAND_REPLIES — issue an arbitrary SMTP verb and retrieve the server's reply codes and text.
  • MAIL — specifies the envelope sender (the "MAIL FROM" address).
  • RCPT — specifies one or more envelope recipients ("RCPT TO").
  • DATA / OPEN_DATA / WRITE_DATA / WRITE_RAW_DATA / CLOSE_DATA — begin the message body, stream header and body content (text or raw), and terminate the message with the terminating dot sequence.
  • RSET — resets the current transaction without dropping the connection.
  • VRFY, HELP, NOOP — diagnostic and verification verbs.
  • QUIT / CLOSE_CONNECTION — end the SMTP session and release the network socket.

These routines are primitive by design; header assembly, MIME encoding, and recipient formatting are the responsibility of the calling layer.

Tables Accessed

The ETRM metadata records no APPS-schema tables referenced by UTL_SMTP. This is consistent with the purpose of the package: it is a network protocol utility rather than a data-manipulation API. It reads no application tables and writes no application tables. Its only external dependency of consequence is UTL_TCP, through which all socket-level input and output is performed. Any configuration values — SMTP host, port, sender address, relay credentials — are passed by the caller and are not persisted by this package.

Usage Notes

In EBS 12.1.1 and 12.2.2, UTL_SMTP is invoked indirectly whenever the instance delivers mail through SMTP. The Workflow Notification Mailer and the AQ e-mail gateway (DBMS_AQELM) use it as their transport when configured for outbound SMTP rather than an external mailer. The package is also referenced by DBMS_ISCHED. Custom PL/SQL that must send mail programmatically can call UTL_SMTP directly, but developers should be aware that the package requires the UTL_TCP access control list (ACL) to permit outbound connections from the database in 11g and later releases; without the appropriate ACL grant, calls fail at OPEN_CONNECTION. Because the API is undocumented for general use and owned by SYS, Oracle recommends that EBS developers prefer Oracle Workflow notification APIs or the standard Notification Mailer configuration wherever an application-level message is required, reserving direct UTL_SMTP calls for cases that cannot be met through supported interfaces.