The WRITE_DATA procedure is used to send the text content of an email message 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 that order.OPEN_DATAsends theDATAcommand to declare the start of sending the email content. After that, you can callWRITE_DATAandWRITE_RAW_DATAmultiple times to send the email body. Finally,CLOSE_DATAsends the terminating character to end the sending.- The application must ensure that the text content complies with the
MIME (RFC822)specification. Use<CR><LF>.<CR><LF>as the terminating message. 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 inUS7ASCIIwill be converted to the?character. - If the
ehlocommand andsmtpserver negotiate the8BITMIMEextension, you can use theutl_rawpackage to convert the text torawdata and then send it usingwrite_raw_data.