OPEN_CONNECTION is used to open and return a connection to an SMTP service.
Applicability
This topic applies only to OceanBase Database in Oracle mode.
Syntax
UTL_SMTP.OPEN_CONNECTION (
host IN VARCHAR2,
port IN PLS_INTEGER DEFAULT 25,
c OUT connection,
tx_timeout IN PLS_INTEGER DEFAULT NULL,
wallet_path IN VARCHAR2 DEFAULT NULL,
wallet_password IN VARCHAR2 DEFAULT NULL,
secure_connection_before_smtp IN BOOLEAN DEFAULT FALSE,
secure_host IN VARCHAR2 DEFAULT NULL)
RETURN reply;
UTL_SMTP.OPEN_CONNECTION (
host IN VARCHAR2,
port IN PLS_INTEGER DEFAULT 25,
tx_timeout IN PLS_INTEGER DEFAULT NULL,
wallet_path IN VARCHAR2 DEFAULT NULL,
wallet_password IN VARCHAR2 DEFAULT NULL,
secure_connection_before_smtp IN BOOLEAN DEFAULT FALSE,
secure_host IN VARCHAR2 DEFAULT NULL)
RETURN connection;
Parameters
Parameter |
Description |
|---|---|
| host | The host name of the SMTP service. |
| port | The port number of the SMTP service (usually 25). |
| c | The SMTP connection. |
| tx_timeout | The amount of time (in seconds) that the UTL_SMTP package waits before timing out for read and write operations on the connection. In read operations, if no data is immediately available to read, this package will time out. In write operations, if the output buffer is full and no data can be sent to the network without being blocked, this package will time out. 0 means no wait, and NULL means wait indefinitely. |
| wallet_path | This parameter is not supported and defaults to NULL. |
| wallet_password | This parameter is not supported and defaults to NULL. |
| secure_connection_before_smtp | If TRUE, a secure connection using SSL/TLS is established before SMTP communication. If FALSE, no secure connection is established. (Only FALSE is supported at this time.) |
| secure_host | This parameter is not supported and defaults to NULL. |
Return value
Return value |
Description |
|---|---|
| reply | The reply to the command. If there are multiple replies, the last one is returned. |
Considerations
- The expected reply code is
220, indicating that the SMTP server is ready to handle requests from the client. - When
utl_smtp.connectionis returned, the reply code is checked. If the reply indicates an error, an exception is thrown. Whenutl_smtp.replyis returned, the user must check the reply. tx_timeoutis intended to manage read and write operations. However, implementation limitations preventtx_timeoutfrom managing write operations in the current version.
