Package gokemal Interface for calling the UTL_SMTP routine to enable the sending of e-mail (gokemal).The interface enables the sending of e-mails utilizing UTL_SMTP. Messages may specify up to 100 recipients identified as 'TO:', 'CC:', and 'BCC:'. If the message being sent has the < html > [without spaces] tag embedded anywhere in the message, then the message will be sent as an HTML message, otherwise plain text is assumed. The maximum length of all data being sent (including headers, recipient names, subject line, and message text) is 32,767 characters. |
Program units |
p_send_email | Use this procedure to send an e-mail via UTL_SMTP. |
p_send_email
PROCEDURE p_send_email(p_to_addr IN VARCHAR2, p_to_name IN VARCHAR2 DEFAULT NULL, p_to_delim IN VARCHAR2 DEFAULT NULL, p_cc_addr IN VARCHAR2 DEFAULT NULL, p_cc_name IN VARCHAR2 DEFAULT NULL, p_cc_delim IN VARCHAR2 DEFAULT NULL, p_bcc_addr IN VARCHAR2 DEFAULT NULL, p_bcc_name IN VARCHAR2 DEFAULT NULL, p_bcc_delim IN VARCHAR2 DEFAULT NULL, p_from_addr IN VARCHAR2, p_from_name IN VARCHAR2 DEFAULT NULL, p_host IN VARCHAR2, p_port IN PLS_INTEGER DEFAULT NULL, p_subject IN VARCHAR2 DEFAULT NULL, p_message IN VARCHAR2 DEFAULT NULL, p_debug IN VARCHAR2 DEFAULT 'N', p_success_out OUT VARCHAR2, p_reply_out OUT VARCHAR2, p_text_sent_out OUT VARCHAR2, p_debug_msg_out OUT VARCHAR2)
Use this procedure to send an e-mail via UTL_SMTP.
Parameters |
p_to_addr |
The e-mail address that the message should be sent to. Multiple addresses may be identified if the p_to_delim is specified. See p_to_delim for more information. VARCHAR2. Required. NOTE: The format of the e-mail address may be either just the address (i.e. jsmith @ abc.com [without the spaces]) or a combination of address and name (i.e. "J Smith"< jsmith @ abc.com > [without the spaces]) | ||||||||||
p_to_name |
An optional name that can be used for additional identifying information together with the p_to_addr e-mail address. If supplied (and the p_to_delim is null), the e-mail will be sent to "name"<e-mail address>. VARCHAR2. Optional. | ||||||||||
p_to_delim |
An optional string of characters (typically just the semi-colon [;]) used to identify separators between multiple e-mail addresses entered in the p_to_addr field. If this field is not null, then the p_to_name field will be ignored. A maximum of 100 e-mail addresses may be passed in p_to_addr when this field is used. VARCHAR2. Optional. | ||||||||||
p_cc_addr |
The e-mail address that a copy of the message should be sent to (i.e. CC:). Multiple addresses may be identified if the p_cc_delim is specified. See p_cc_delim for more information. VARCHAR2. Optional. NOTE: The format of the e-mail address may be either just the address (i.e. jsmith @ abc.com [without the spaces]) or a combination of address and name (i.e. "J Smith"< jsmith @ abc.com > [without the spaces]) | ||||||||||
p_cc_name |
An optional name that can be used for additional identifying information together with the p_cc_addr e-mail address. If supplied (and the p_cc_delim is null), the e-mail will be sent to "name"<e-mail address>. VARCHAR2. Optional. | ||||||||||
p_cc_delim |
An optional string of characters (typically just the semi-colon [;]) used to identify separators between multiple e-mail addresses entered in the p_cc_addr field. If this field is not null, then the p_cc_name field will be ignored. A maximum of 100 e-mail addresses may be passed in p_cc_addr when this field is used. VARCHAR2. Optional. | ||||||||||
p_bcc_addr |
The e-mail address that a blind copy of the message should be sent to (i.e. BCC:). Multiple addresses may be identified if the p_bcc_delim is specified. See p_bcc_delim for more information. VARCHAR2. Optional. NOTE: The format of the e-mail address may be either just the address (i.e. jsmith @ abc.com [without the spaces]) or a combination of address and name (i.e. "J Smith"< jsmith @ abc.com > [without the spaces]) | ||||||||||
p_bcc_name |
An optional name that can be used for additional identifying information together with the p_bcc_addr e-mail address. If supplied (and the p_bcc_delim is null), the e-mail will be sent to "name"<e-mail address>. VARCHAR2. Optional. | ||||||||||
p_bcc_delim |
An optional string of characters (typically just the semi-colon [;]) used to identify separators between multiple e-mail addresses entered in the p_bcc_addr field. If this field is not null, then the p_bcc_name field will be ignored. A maximum of 100 e-mail addresses may be passed in p_bcc_addr when this field is used. VARCHAR2. Optional. | ||||||||||
p_from_addr |
The e-mail address to be used as the FROM: address. Only one address is permitted. VARCHAR2. Required. NOTE: The format of the e-mail address may be either just the address (i.e. jsmith @ abc.com [without the spaces]) or a combination of address and name (i.e. "J Smith"< jsmith @ abc.com > [without the spaces]) | ||||||||||
p_from_name |
An optional name that can be used for additional identifying information together with the p_from_addr e-mail address. If supplied the e-mail will be sent from "name"<e-mail address>. VARCHAR2. Optional. | ||||||||||
p_host |
The name of the SMTP server host that will be used to transport the e-mail messages. VARCHAR2. Required. | ||||||||||
p_port |
The port number on which SMTP server is listening (usually 25). PLS_INTEGER. Optional. If not supplied, then a default value of 25 will be used. | ||||||||||
p_subject |
The text that should be used as the Subject: line in the e-mail being sent. A maximum of 32,000 characters may be used. The 32,000 maximum length implies the inclusion of the length of the DATE, FROM, TO, and CC values as well. VARCHAR2. Optional. | ||||||||||
p_message |
The text of the e-mail message that should be sent. A maximum of 32,000 characters may be used. VARCHAR2. Optional. | ||||||||||
p_debug |
A indicator that defaults to 'N' indicating whether or not and e-mail should actually be sent and whether or not the p_reply_out and p_text_sent_out fields should be populated.
| ||||||||||
p_success_out |
Indicates the success (with a value of 'Y') or failure (with a value of 'N'). The p_reply_out field will have additional error information if the value is 'N'. VARCHAR2(1). Required. | ||||||||||
p_reply_out |
If the p_success_out value is 'N' (indicating a failure), the field will contain the error message. If the error is from the UTL_SMTP process, the information will be similar to: ORA-29279: SMTP permanent error: 552/[CLOSE_DATA] 5.6.0 Headers too large (32768 max) In this case the UTL_SMTP.CLOSE_DATA routine returned an error code of 552. VARCHAR2(1000). Required. | ||||||||||
p_text_sent_out |
If the p_return_info is set to 'Y', then this field will represent the full text (up to 32,000 characters) of the e-mail message that was sent. If the p_return_info is set to 'N', then this field will be NULL. VARCHAR2(32000). Required. | ||||||||||
p_debug_msg_out |
If the p_return_info is set to 'Y', then this field will represent the full text (up to 32,000 characters) of responses from each of the UTL_SMTP processes that were executed. Each of the message will be of the format: (1) 220/[OPEN_CONNECTION] mail.server.com ESMTP Sendmail 8.14.3/8.14.3; Tue, 2 Aug 2011 20:36:48 -0400 In this case, indicating the response code of 220 from the UTL_SMTP.OPEN_CONNECTION process. If the p_return_info is set to 'N', then this field will be NULL. VARCHAR2(32000). Required. |