The WRITE_DATA procedure is used to send the text content of an email and can be called multiple times to append data to the email.
Applicability
This topic applies only to OceanBase Database in Oracle mode.
Syntax
UTL_SMTP.WRITE_DATA (
c IN OUT NOCOPY connection,
data IN VARCHAR2 CHARACTER SET ANY_CS);
Parameters
Parameter |
Description |
|---|---|
| c | The SMTP connection. |
| data | A part of the message text to be sent. It contains headers and is in [RFC822] format. |
Considerations
OPEN_DATA,WRITE_DATA,WRITE_RAW_DATA, andCLOSE_DATAmust be called in strict sequence.open_datasends thedatacommand to declare the start of sending email content. After that, you can callwrite_dataandwrite_raw_datamultiple times to send the email body, and finally callclose_datato send the terminator and end the sending.- The application must ensure that the text content complies with the
MIME (RFC822)specification. Use<CR><LF>.<CR><LF>as the message terminator. The<CR><LF>.<CR><LF>in the text content will be translated to<CR><LF>..<CR><LF>. - Text (varchar2) data will be converted to the
US7ASCIIcharacter set before being sent. If the text contains multi-byte characters, each multi-byte character that cannot be represented in theUS7ASCIIcharacter set will be converted to the?character. - If the
ehlocommand and thesmtpserver negotiate the8BITMIMEextension, you can use theutl_rawpackage to convert the text torawdata and then send it usingwrite_raw_data.
