PL/SQL Packages and Types Reference 10g Release 1 (10.1) Part Number B10802-01 |
|
|
View PDF |
The UTL_MAIL
package is a utility for managing email which includes commonly used email features, such as attachments, CC, BCC, and return receipt.
This chapter contains the following topics:
UTL_MAIL
is not installed by default because of the SMTP_OUT_SERVER
configuration requirement and the security exposure this involves. In installing UTL_MAIL
, you should take steps to prevent the port defined by SMTP_OUT_SERVER
being swamped by data transmissions.
You must both install UTL_MAIL
and define the SMTP_OUT_SERVER.
sqlplus sys/<pwd> SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql SQL> @$ORACLE_HOME/rdbms/admin/prvtmail.sql
SMTP_OUT_SERVER
parameter in the init
.ora
rdbms
initialization file. However, if SMTP_OUT_SERVER
is not defined, this invokes a default of DB_DOMAIN
which is guaranteed to be defined to perform appropriately.This procedure packages an email message into the appropriate format, locates SMTP information, and delivers the message to the SMTP server for forwarding to the recipients. It hides the SMTP API and exposes a one-line email facility for ease of use.
UTL_MAIL.SEND ( sender IN VARCHAR2 CHARACTER SET ANY_CS, recipients IN VARCHAR2 CHARACTER SET ANY_CS, cc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, bcc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, subject IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, message IN VARCHAR2 CHARACTER SET ANY_CS, mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=us-ascii', priority IN PLS_INTEGER DEFAULT NULL);
This procedure is the SEND
Procedure overloaded for RAW
attachments.
UTL_MAIL.SEND_ATTACH_RAW ( sender IN VARCHAR2 CHARACTER SET ANY_CS, recipients IN VARCHAR2 CHARACTER SET ANY_CS, cc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, bcc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, subject IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, message IN VARCHAR2 CHARACTER SET ANY_CS, mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=us-ascii', priority IN PLS_INTEGER DEFAULT NULL attachment IN RAW, att_inline IN BOOLEAN DEFAULT TRUE, att_mime_type IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT 'application/octet', att_filename IN VARCHAR2 DEFAULT NULL);
This procedure is the SEND
Procedure overloaded for VARCHAR2
attachments.
UTL_MAIL.SEND_ATTACH_VARCHAR2 ( sender IN VARCHAR2 CHARACTER SET ANY_CS, recipients IN VARCHAR2 CHARACTER SET ANY_CS, cc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, bcc IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, subject IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, message IN VARCHAR2 CHARACTER SET ANY_CS, mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=us-ascii', priority IN PLS_INTEGER DEFAULT NULL attachment IN RAW, att_inline IN BOOLEAN DEFAULT TRUE, att_mime_type IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT 'application/octet', att_filename IN VARCHAR2 DEFAULT NULL);