3.23 UTL_SMTP

Table of Contents Previous Next


3 Built-In Packages : 3.23 UTL_SMTP

The UTL_SMTP package provides the capability to send e-mails over the Simple Mail Transfer Protocol (SMTP).
Note: An administrator must grant execute privileges to each user or group before they can use this package.
CLOSE_DATA(c IN OUT)
COMMAND(c IN OUT, cmd [, arg ])
COMMAND_REPLIES(c IN OUT, cmd [, arg ])
DATA(c IN OUT, body VARCHAR2)
EHLO(c IN OUT, domain)
HELO(c IN OUT, domain)
Send the HELP command.
MAIL(c IN OUT, sender [, parameters ])
NOOP(c IN OUT)
OPEN_CONNECTION(host [, port [, tx_timeout ]])
OPEN_DATA(c IN OUT)
Send the DATA command.
QUIT(c IN OUT)
RCPT(c IN OUT, recipient [, parameters ])
RSET(c IN OUT)
VRFY(c IN OUT, recipient)
WRITE_DATA(c IN OUT, data)
Advanced Server's implementation of UTL_SMTP is a partial implementation when compared to Oracle's version. Only those functions and procedures listed in the table above are supported.
3.23.1 CONNECTION
The CONNECTION record type provides a description of an SMTP connection.
The REPLY record type provides a description of an SMTP reply line. REPLIES is a table of multiple SMTP reply lines.
3.23.3 CLOSE_DATA
The CLOSE_DATA procedure terminates an e-mail message by sending the following sequence:
CLOSE_DATA(c IN OUT CONNECTION)
3.23.4 COMMAND
The COMMAND procedure provides the capability to execute an SMTP command. If you are expecting multiple reply lines, use COMMAND_REPLIES.
reply REPLY COMMAND(c IN OUT CONNECTION, cmd VARCHAR2
[, arg VARCHAR2 ])
COMMAND(c IN OUT CONNECTION, cmd VARCHAR2 [, arg VARCHAR2 ])
See Section 3.23.2 for a description of REPLY and REPLIES.
The COMMAND_REPLIES function processes an SMTP command that returns multiple reply lines. Use COMMAND if only a single reply line is expected.
replies REPLIES COMMAND(c IN OUT CONNECTION, cmd VARCHAR2
[, arg VARCHAR2 ])
SMTP reply lines to the command. See Section 3.23.2 for a description of REPLY and REPLIES.
3.23.6 DATA
The DATA procedure provides the capability to specify the body of the e-mail message. The message is terminated with a <CR><LF>.<CR><LF> sequence.
DATA(c IN OUT CONNECTION, body VARCHAR2)
3.23.7 EHLO
The EHLO procedure performs initial handshaking with the SMTP server after establishing the connection. The EHLO procedure allows the client to identify itself to the SMTP server according to RFC 821. RFC 1869 specifies the format of the information returned in the server’s reply. The HELO procedure performs the equivalent functionality, but returns less information about the server.
EHLO(c IN OUT CONNECTION, domain VARCHAR2)
3.23.8 HELO
The HELO procedure performs initial handshaking with the SMTP server after establishing the connection. The HELO procedure allows the client to identify itself to the SMTP server according to RFC 821. The EHLO procedure performs the equivalent functionality, but returns more information about the server.
HELO(c IN OUT, domain VARCHAR2)
3.23.9 HELP
The HELP function provides the capability to send the HELP command to the SMTP server.
replies REPLIES HELP(c IN OUT CONNECTION [, command VARCHAR2 ])
SMTP reply lines to the command. See Section 3.23.2 for a description of REPLY and REPLIES.
3.23.10 MAIL
The MAIL procedure initiates a mail transaction.
MAIL(c IN OUT CONNECTION, sender VARCHAR2
[, parameters VARCHAR2 ])
Mail command parameters in the format, key=value as defined in RFC 1869.
3.23.11 NOOP
The NOOP function/procedure sends the null command to the SMTP server. The NOOP has no effect upon the server except to obtain a successful response.
reply REPLY NOOP(c IN OUT CONNECTION)
NOOP(c IN OUT CONNECTION)
The OPEN_CONNECTION functions open a connection to an SMTP server.
c CONNECTION OPEN_CONNECTION(host VARCHAR2 [, port PLS_INTEGER [, tx_timeout PLS_INTEGER DEFAULT NULL]])
3.23.13 OPEN_DATA
The OPEN_DATA procedure sends the DATA command to the SMTP server.
OPEN_DATA(c IN OUT CONNECTION)
3.23.14 QUIT
The QUIT procedure closes the session with an SMTP server.
QUIT(c IN OUT CONNECTION)
3.23.15 RCPT
The RCPT procedure provides the e-mail address of the recipient. To schedule multiple recipients, invoke RCPT multiple times.
RCPT(c IN OUT CONNECTION, recipient VARCHAR2
[, parameters VARCHAR2 ])
Mail command parameters in the format, key=value as defined in RFC 1869.
3.23.16 RSET
The RSET procedure provides the capability to terminate the current mail transaction.
RSET(c IN OUT CONNECTION)
3.23.17 VRFY
The VRFY function provides the capability to validate and verify the recipient’s e-mail address. If valid, the recipient’s full name and fully qualified mailbox is returned.
reply REPLY VRFY(c IN OUT CONNECTION, recipient VARCHAR2)
3.23.18 WRITE_DATA
The WRITE_DATA procedure provides the capability to add VARCHAR2 data to an e-mail message. The WRITE_DATA procedure may be repetitively called to add data.
WRITE_DATA(c IN OUT CONNECTION, data VARCHAR2)
The following example uses the OPEN_DATA, WRITE_DATA, and CLOSE_DATA procedures instead of the DATA procedure.

3 Built-In Packages : 3.23 UTL_SMTP

Table of Contents Previous Next