Search Results end_mail_in_session
Overview
OKS_MAIL is an Oracle E-Business Suite PL/SQL package owned by the APPS schema that provides a generic, reusable framework for constructing and transmitting outbound SMTP electronic mail from within the E-Business Suite. It is a foundational utility for the Service Contracts (OKS) product family, where automated notifications — such as contract renewal reminders, expiration alerts, and quote delivery messages — must be dispatched to customers, partners, or internal personnel without human intervention. Rather than replicating low-level mail transport logic in each calling program, OKS_MAIL encapsulates the entire SMTP conversation, including session establishment, MIME header composition, message body generation, and attachment handling. In Oracle EBS 12.1.1 and 12.2.2, the package is documented with a status of VALID and is classified as an OTHER API, indicating it is intended primarily as internal infrastructure rather than a published, externally certified interface.
Key Procedures and Functions
The package exposes a documented set of 24 procedures and functions that span the complete lifecycle of an SMTP transaction:
- Session control: BEGIN_SESSION and END_SESSION open and close the connection to the SMTP server through UTL_SMTP.
- Message framing: BEGIN_MAIL, BEGIN_MAIL_IN_SESSION, END_MAIL, and END_MAIL_IN_SESSION start and terminate an individual message, allowing multiple messages to be sent within one session.
- Message metadata: GET_ADDRESS resolves sender or recipient address information, while WRITE_MIME_HEADER and WRITE_BOUNDARY emit MIME headers and multipart boundaries.
- Body and content generation: WRITE_TEXT, WRITE_MB_TEXT, and WRITE_RAW write the textual or raw message content, and the top-level MAIL procedure orchestrates a complete single-message send.
- Attachments: BEGIN_ATTACHMENT and END_ATTACHMENT delimit attachment parts, while ATTACH_TEXT, ATTACH_BASE64, SEND_ATTACHMENT, SEND_TEXT_ATTACHMENT, and SEND_BINARY_ATTACHMENT encode and transmit attached content in text or binary form.
Tables Accessed
OKS_MAIL does not read or write any application data tables. Its dependencies are entirely on server-side infrastructure packages accessed through APPS synonyms: UTL_SMTP for the SMTP protocol, UTL_TCP for the underlying socket transport, UTL_RAW and DBMS_LOB for binary and large object handling, UTL_HTTP for HTTP-based retrieval, and PLITBLM for PL/SQL table support. Configuration values such as the outgoing mail server are obtained indirectly through FND_PROFILE and FND_GLOBAL, which supply profile option and session context values. The package is also dependent on OKS_AUTO_REMINDER, linking it directly to the Service Contracts reminder subsystem.
Usage Notes
OKS_MAIL is an internal utility rather than an end-user-facing API. It is most commonly invoked from concurrent programs, workflow notification handlers, and database triggers associated with Service Contracts renewal and reminder processing. Custom development teams can call the same procedures to emit transactional notifications from bespoke PL/SQL, provided the concurrent manager or calling session has access to a reachable SMTP host. Because the SMTP connection is established with BEGIN_SESSION, code that sends multiple messages should reuse a single session for efficiency and must guarantee that END_SESSION is executed to avoid orphaned connections. The package body is documented as valid on both 12.1.1 and 12.2.2, and the metadata indicates no other packages reference it, so its behavior is effectively self-contained.
-
PACKAGE: APPS.OKS_MAIL
12.1.1
-
PACKAGE: APPS.OKS_MAIL
12.2.2
-
PACKAGE BODY: APPS.OKS_MAIL
12.1.1
-
PACKAGE BODY: APPS.OKS_MAIL
12.2.2
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.1.1
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.2.2
-
APPS.OKS_MAIL dependencies on FND_FILE
12.1.1
-
APPS.OKS_MAIL dependencies on FND_FILE
12.2.2
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.1.1
-
APPS.OKS_MAIL dependencies on UTL_SMTP
12.2.2