oracle 11G utl_mail 自动发邮件
2013-03-08 16:21
169 查看
UTL_MAIL
The
This chapter contains the following topics:
Using UTL_MAIL
Security Model
Operational Notes
Rules and Limits
Summary of UTL_MAIL Subprograms
Operational Notes
Rules and Limits
This package is now an invoker's rights package and the invoking user will need the connect privilege granted in the access control list assigned to the remote network host to which he wants to connect.
Note:
For more information, see
Managing Fine-grained Access to External Network Services in
Oracle Database Security Guide
To install UTL_MAIL:
You define the
Syntax
Parameters
Table 229-2 SEND Procedure Parameters
Syntax
Parameters
Table 229-3
SEND_ATTACH_RAW Procedure Parameters
Syntax
Parameters
Table 229-4 SEND_ATTACH_VARCHAR2 Procedure Parameters
The
UTL_MAILpackage is a utility for managing email which includes commonly used email features, such as attachments, CC, and BCC.
This chapter contains the following topics:
Using UTL_MAIL
Security Model
Operational Notes
Rules and Limits
Summary of UTL_MAIL Subprograms
Using UTL_MAIL
Security ModelOperational Notes
Rules and Limits
Security Model
UTL_MAILis not installed by default because of the
SMTP_OUT_SERVERconfiguration requirement and the security exposure this involves. In installing
UTL_MAIL, you should take steps to prevent the port defined by
SMTP_OUT_SERVERbeing swamped by data transmissions
.
This package is now an invoker's rights package and the invoking user will need the connect privilege granted in the access control list assigned to the remote network host to which he wants to connect.
Note:
For more information, see
Managing Fine-grained Access to External Network Services in
Oracle Database Security Guide
Operational Notes
You must both installUTL_MAILand define the
SMTP_OUT_SERVER.
To install UTL_MAIL:
sqlplus sys/<pwd> SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql SQL> @$ORACLE_HOME/rdbms/admin/prvtmail.plb
You define the
SMTP_OUT_SERVERparameter in the
init.
ora
rdbmsinitialization file. However, if
SMTP_OUT_SERVERis not defined, this invokes a default of
DB_DOMAINwhich is guaranteed to be defined to perform appropriately.
Rules and Limits
UseUTL_MAILonly within the context of the ASCII (American Standard Code for Information Interchange) and EBCDIC (Extended Binary-Coded Decimal Interchange Code) codes.
Summary of UTL_MAIL Subprograms
Table 229-1 UTL_MAIL Package SubprogramsSubprogram | Description |
---|---|
SEND 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 |
SEND_ATTACH_RAW Procedure | Represents the SENDProcedure overloaded for RAWattachments |
SEND_ATTACH_VARCHAR2 Procedure | Represents the SENDProcedure overloaded for VARCHAR2attachments |
SEND Procedure
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.Syntax
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 3, replyto IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);
Parameters
Table 229-2 SEND Procedure Parameters
Parameter | Description |
---|---|
sender | Email address of the sender |
recipients | Email addresses of the recipient(s), separated by commas |
cc | Email addresses of the CC recipient(s), separated by commas, default is NULL |
bcc | Email addresses of the BCC recipient(s), separated by commas, default is NULL |
subject | String to be included as email subject string, default is NULL |
message | Text message body |
mime_type | Mime type of the message, default is 'text/plain; charset=us-ascii' |
priority | Message priority, which maps to the X-priority field. 1 is the highest priority and 5 the lowest. The default is 3. |
replyto | Defines to whom the reply email is to be sent |
SEND_ATTACH_RAW Procedure
This procedure is theSENDProcedure overloaded for
RAWattachments.
Syntax
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 DEFAULT NULL, mime_type IN VARCHAR2 DEFAULT CHARACTER SET ANY_CS DEFAULT 'text/plain; charset=us-ascii', priority IN PLS_INTEGER DEFAULT 3, attachment IN RAW, att_inline IN BOOLEAN DEFAULT TRUE, att_mime_type IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT 'text/plain; charset=us-ascii', att_filename IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL, replyto IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);
Parameters
Table 229-3
SEND_ATTACH_RAW Procedure Parameters
Parameter | Description |
---|---|
sender | Email address of the sender |
recipients | Email addresses of the recipient(s), separated by commas |
cc | Email addresses of the CC recipient(s), separated by commas, default is NULL |
bcc | Email addresses of the BCC recipient(s), separated by commas, default is NULL |
subject | String to be included as email subject string, default is NULL |
message | Text message body |
mime_type | Mime type of the message, default is 'text/plain; charset=us-ascii' |
priority | Message priority, which maps to the X-priority field. 1 is the highest priority and 5 the lowest. The default is 3. |
attachment | RAWattachment |
att_inline | Specifies whether the attachment is viewable inline with the message body, default isTRUE |
att_mime_type | Mime type of the attachment, default is 'application/octet' |
att_filename | String specifying a filename containing the attachment, default is NULL |
replyto | Defines to whom the reply email is to be sent |
SEND_ATTACH_VARCHAR2 Procedure
This procedure is theSENDProcedure overloaded for
VARCHAR2attachments.
Syntax
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 DEFAULT NULL, mime_type IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT 'text/plain; charset=us-ascii', priority IN PLS_INTEGER DEFAULT 3, attachment IN VARCHAR2 CHARACTER SET ANY_CS, , att_inline IN BOOLEAN DEFAULT TRUE, att_mime_type IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT 'text/plain; charset=us-ascii, att_filename IN VARCHAR2CHARACTER SET ANY_CS DEFAULT NULL, replyto IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);
Parameters
Table 229-4 SEND_ATTACH_VARCHAR2 Procedure Parameters
Parameter | Description |
---|---|
sender | Email address of the sender |
recipients | Email addresses of the recipient(s), separated by commas |
cc | Email addresses of the CC recipient(s), separated by commas, default is NULL |
bcc | Email addresses of the BCC recipient(s), separated by commas, default is NULL |
subject | String to be included as email subject string, default is NULL |
message | Text message body |
mime_type | Mime type of the message, default is 'text/plain; charset=us-ascii |
priority | Message priority, which maps to the X-priority field. 1 is the highest priority and 5 the lowest. The default is 3. |
attachment | Text attachment |
att_inline | Specifies whether the attachment is inline, default TRUE |
att_mime_type | Mime type of the attachment, default is 'text/plain; charset=us-ascii' |
att_filename | String specifying a filename containing the attachment, default is NULL |
replyto | Defines to whom the reply email is to be sent |
相关文章推荐
- Oracle 11G中轻松发送email -- UTL_MAIL
- oracle 11g 新特性UTL_TCP、UTL_HTTP 和 UTL_SMTP程序包发邮件
- Oracle 11g 使用 UTL_MAIL 包实现存储过程发送邮件
- Oracle 11g 使用 UTL_MAIL 包实现存储过程发送邮件
- Oracle管理监控之使用utl_mail自动邮件报警配置
- Linux配置Oracle 11g自动启动
- oracle 11g 自动维护任务
- 利用Oracle的UTL_SMTP包发邮件设置超送
- 关于Oracle统计中关于操作系统的统计说明,oracle10个/11g的新特点 自动工作量资料 推荐
- Oracle 11g自动诊断信息库(Automatic Diagnostic Repository,ADR)概述
- Debian 6 设置Oracle 11g R2开机自动启动
- Oracle 11g RAC 自动应用PSU补丁简明版
- oracle的UTL_mail与任务调度详细分析实例
- 关于Oracle统计中关于操作系统的统计说明,oracle10个/11g的新特点 自动工作量资料
- Oracle 11g数据库每天自动备份的实现方法
- oracle 11g中的自动维护任务管理
- oracle 11g 自动内存管理。
- Oracle 11g随Redhat 5系统自动启动与关闭的设置方法
- oracle 11g 自动收集统计信息 导致IO过大
- Oracle 11g RAC自动打GI PSU补丁(11.2.0.4.8)