Search Results send_attach_raw




Overview

SYS.UTL_MAIL is the Oracle-supplied PL/SQL package that provides a supported, server-side interface for composing and delivering outbound electronic mail from within the Oracle database. Unlike the older TCP-based UTL_SMTP package, which requires the developer to manually negotiate the SMTP handshake and construct RFC-compliant message headers, UTL_MAIL performs the message packaging internally and forwards the completed message to the SMTP server defined by the database initialization parameters SMTP_SERVER and SMTP_DOMAIN. From the perspective of Oracle E-Business Suite Release 12.1.1 and 12.2.2, the package serves as a general-purpose notification utility available to any PL/SQL code executing in the database, including custom concurrent programs, database triggers, workflow notification handlers, and form-based personalizations that need to emit an ad hoc email independent of the standard Workflow Notification Mailer infrastructure.

The package is owned by SYS and is classified under the ETRM as OTHER. It is not an Application Object Library API and carries no EBS-specific business logic; its role in the EBS context is that of an infrastructure dependency rather than a functional application interface.

Key Procedures and Functions

The ETRM documents three procedures in the package. All three are overloaded forms of the same core send operation, differing only in attachment handling.

  • SEND — Sends a plain email message with no attachment. It accepts one or more comma-delimited recipients, optional CC and BCC recipient lists, a subject, a message body, a MIME type (defaulting to text/plain), and a priority value. The declared invalid_argument exception is initialized to Oracle error -29261, and invalid_priority to -44101, reflecting validation of the supplied parameters and of the priority range.
  • SEND_ATTACH_VARCHAR2 — Sends a message with a single attachment supplied as character (VARCHAR2) data. In addition to the parameters accepted by SEND, it takes an attachment, an att_mime_type, and an att_txt_inline flag that controls whether the attachment is rendered inline with the message body or carried as a separate part.
  • SEND_ATTACH_RAW — Sends a message with a single attachment supplied as binary (RAW) data, suitable for non-textual payloads. It mirrors the attachment-oriented parameter model of SEND_ATTACH_VARCHAR2 while accepting the binary form.

Tables Accessed

The ETRM metadata records no tables referenced through APPS synonyms for this package, and no EBS application tables are read or written by UTL_MAIL. Message delivery is performed entirely through the database's SMTP configuration rather than through inserts into an EBS mail table. The package therefore participates in no transactional data model; mail dispatched through it is not recorded in the Workflow notification tables (such as WF_NOTIFICATIONS) and is not visible in the EBS notification worklist.

Usage Notes

UTL_MAIL is typically invoked directly from custom PL/SQL. Common EBS scenarios include sending a completion message from a custom concurrent program after the concurrent request finishes, alerting support staff from an error-handling block, or emitting a one-off message from a form personalization or database trigger where routing through Workflow would be disproportionate to the requirement.

Two operational prerequisites govern its use. Execution privilege on the package must be explicitly granted, since the package is created under SYS and is not executable by PUBLIC. In addition, the SMTP_SERVER and SMTP_DOMAIN database initialization parameters must be configured, and the database host must be able to resolve and reach the designated SMTP relay on the network. Because the package blocks while performing the SMTP exchange, it is generally unsuitable for high-volume, transactionally coupled messaging; Workflow remains the appropriate mechanism where delivery tracking, retry, and integration with the EBS notification worklist are required. The ETRM records no dependencies on this package from other packages, so its removal or restriction would not cascade through documented EBS code paths.