WRITE_DATA is used to send text email content. It can be called multiple times to append data to the email.
Applicability
This content applies only to the Oracle-compatible mode of OceanBase Database.
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 send. The headers section is included. It is in the [RFC822] format. |
Considerations
OPEN_DATA,WRITE_DATA,WRITE_RAW_DATA, andCLOSE_DATAmust be called in strict sequence.OPEN_DATAsends thedatacommand to indicate the start of email content transmission. Multiple calls toWRITE_DATAandWRITE_RAW_DATAcan then be made to send the email body, and finally,CLOSE_DATAsends the terminator to end the transmission.- The application must ensure that the text content complies with the
MIME (RFC822)standard. Use<CR><LF>.<CR><LF>as the message terminator. Any<CR><LF>.<CR><LF>in the text content will be escaped as<CR><LF>..<CR><LF>. - Text (varchar2) data will be converted to the
US7ASCIIcharacter set before being sent. If the text contains multibyte characters, each multibyte character that cannot be represented inUS7ASCIIwill be converted to a?character. - If the
ehlocommand negotiates the8BITMIMEextension with the SMTP server, the text can be converted torawdata using theutl_rawadvanced package and then sent usingWRITE_RAW_DATA.