Home » RDBMS Server » Server Utilities » send an email
send an email [message #72774] Thu, 16 October 2003 06:06
sha
Messages: 84
Registered: July 2002
Member
Hi,
I have executed as u said, it opened a window and for few seconds and vanished.Then I executed the third step i.e. the initplsj.sql file.
Then I wrote a stored procedure as
CREATE OR REPLACE PROCEDURE send_email
( sender IN VARCHAR2,
recipient IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2)
AS
mailhost VARCHAR2(100) := 'eth.net';
mail_conn utl_smtp.connection;
BEGIN
mail_conn :=utl_smtp.open_connection(mailhost);
utl_smtp.helo(mail_conn,mailhost);
utl_smtp.mail(mail_conn,sender); -- sender
utl_smtp.rcpt(mail_conn,recipient); -- recipient
utl_smtp.open_data(mail_conn);
utl_smtp.write_data(mail_conn, utl_tcp.CRLF||message);
utl_smtp.close_data(mail_conn);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
utl_smtp.quit(mail_conn);
raise_application_error(-20000,
'Failed tosend mail due to the following error: ' || sqlerrm);
WHEN OTHERS THEN
raise_application_error(-20001,
'The following error has occured: ' || sqlerrm);
END;

and created a procedure
then I executed it as

EXECUTE send_email(‘planetonline@eth.net','psshastri@rediffmail.com','This is a UTL_SMTP-generated email','Hi There !');

I am getting this error.

*
ERROR at line 1:
ORA-20001: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 83
ORA-06512: at "SYS.UTL_SMTP", line 356
ORA-06512: at "SCOTT.SEND_EMAIL", line 21
ORA-06512: at line 1

anybody please help me.All the steps from begining.
right from initjvm.sql to sending a mail successfully.
regards,
shastri
Previous Topic: oracle7.4 - visual dbase5 connectivity
Next Topic: bypass trigger using sqlldr
Goto Forum:
  


Current Time: Sun Jun 30 11:22:58 CDT 2024