I am not sure what are you trying to do, but this part
Originally posted by raf for rec_msg in my_cur
loop
messag := rec_msg.ename;
end loop;
will assign to "messag" only the last ename fetched.
I don't think you meant it this way.
Uff, even more... code after opening connection overwrites even this ename
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
see u are assigning messag to ename first and then this
messag := 'DATE: '||to_char(sysdate, 'dd-mon-yy hh24:mi:ss')||crlf||
'FROM: <'||mitt||'>'||crlf||
'SUBJECT: '||object||crlf||
'TO: '||destinatario1||' '||crlf||messagge;
You have to concat the messag (ename) with messag('DATE: '||to_char(sysdate, 'dd-mon-yy hh24:mi:ss')||crlf||
'FROM: <'||mitt||'>'||crlf||
'SUBJECT: '||object||crlf||
'TO: '||destinatario1||' '||crlf||messagge
try this and modify,
CREATE OR REPLACE procedure send_mail ( mitt IN varchar2,
destinatario1 IN varchar2,
object IN varchar2,
messagge IN varchar2) IS
EXCEPTION
when utl_smtp.transient_error or utl_smtp.permanent_error then
utl_smtp.quit(conn);
raise_application_error (-20000, 'error: '||sqlerrm);
END send_mail;
EXCEPTION
when utl_smtp.transient_error or utl_smtp.permanent_error then
utl_smtp.quit(conn);
raise_application_error (-20000, 'error: '||sqlerrm);
END send_mail;
Bookmarks