pLEASE ADVICE ON THE BELOW MAIL FROM MY FRIEND..
THANKS VERY MUCH
Hi ,
Please go thro' this procedure in oracle pl/sql.This below procedure is not working. When i compile it , it is not giving any error. It is compiled successfully. But if i execute this procedure , it is hanging. Here database server and mail server are in different system. Please tell me what the problem is and how to proceed. 145.145.50.1 is our mail server ip address.
Expecting ur reply,
CREATE OR REPLACE PROCEDURE SP_SEND_MAIL (SENDER IN VARCHAR,RECEIPIENT IN VARCHAR,
MESSAGE IN VARCHAR)
IS
MAILHOST VARCHAR(30):='145.145.50.1';
MAIL_CON UTL_SMTP.CONNECTION;
BEGIN
MAIL_CON:=UTL_SMTP.OPEN_CONNECTION(MAILHOST, 80);
UTL_SMTP.HELO(MAIL_CON, MAILHOST);
UTL_SMTP.MAIL(MAIL_CON, SENDER);
UTL_SMTP.RCPT(MAIL_CON, RECEIPIENT);
UTL_SMTP.DATA(MAIL_CON, MESSAGE);
UTL_SMTP.CLOSE_DATA(MAIL_CON);
UTL_SMTP.QUIT(MAIL_CON);
END;
use functions instead of procedures and get yourself some feedback as
Code:
declare
res utl_file.reply;
...
begin
...
res:=utl_smtp.helo(mail_con, mailhost);
dbms_output.put_line(res);
...
end;
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
Bookmarks