|Email From Oracle PL/SQL (UTL_SMTP) - Email from PL/SQL using UTL_SMTP rather than using external procedures or Java.|
Yogesh Kamath said...Thanks you very much, it helped me a lot.
Is there any way to send text in MAIL BODY, this example describes about sending data/message in subject line.
Jonathan Sanchez said...I have a problem. in the line " UTL_SMTP.write_data(l_mail_conn, UTL_RAW.cast_to_varchar2(UTL_ENCODE.base64_encode(DBMS_LOB.substr(p_attach_blob, l_step, i * l_step + 1))));" return this error : "ORA-06502: PL/SQL: error : longitud de variable raw demasiado grande numérico o de valor"
I'm guessing you are using a multibyte character set so the buffer is too small to hold the raw data. If this is the case, you will need to reduce the step size.
If you have any more problems, please ask questions in the forum.
Sunil said...Nice article! simple and useful!
Chukwuma Imegwu said...My scenario is this, send an alert using UTL_SMTP.
if [ $# -ne 2 ]; then
echo "Usage: $0 SID threshold"
sqlplus -s <
SET HEAD OFF TERM OFF FEED OFF VERIFY OFF
COL pct_free FORMAT 999
Tim... said...Questions in the forum please!
sanjeev said...in clob attachment mail, why you using l_step?
The WRITE_DATA procedure only accepts VARCHAR2, so we have to process the CLOB in chunks. The step is used in the division of the CLOB into suitable chunks.
If WRITE_DATA accepted CLOBs, or your CLOBs were always under 32K in size, this would not be necessary.
I have a question; i perfectec works; but i need it with pdf. anyone has any idea.
first of all thank you very much.
The BLOB method should work with any binary document, like a PDF.
i wish is that i have text that is attached as a pdf; do you know how i can make an example;
i said that change this
p_attach_mime => 'application/pdf'
send mail correctly; but when i open attachment get error.
DO NOT ask technical questions here, that's what my forum is for!
These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!