| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Sending Email from Server - please help !
Hi,
I want to implement email sending mechanism from oracle server. I
don't want it to be done through polling or job.
From the oracle documentation it seems pretty straight forward
(example code at the end).
So I copied and pasted the example code to one sql file. The procedure "send_mail" compiled without problem. But while calling it from another sql procedure gave following runtime errors :
ORA-29540: class oracle/plsql/net/TCPConnection does not exist ORA-06512: at "SYS.UTL_TCP", line 533 ORA-06512: at "SYS.UTL_TCP", line 199 ORA-06512: at "SYS.UTL_SMTP", line 99 ORA-06512: at "SYS.UTL_SMTP", line 121 ORA-06512: at "SECOND.SEND_MAIL", line 8 ORA-06512: at line 5
ERROR Code meanings from Oracle Database
ORA-29540 class string does not exist
Cause: Java method execution failed to find a class with the indicated name.
Action: Correct the name or add the missing Java class.
---
ORA-06512 at stringline string
Cause: Backtrace message as the stack is unwound by unhandled
exceptions.
Action: Fix the problem causing the exception or write an exception
handler for this condition. Or you may need to contact your application
administrator or database administrator.
---------------------------------------------------
I could not make out what really caused this and how to fix this. Has
anyone experienced this ? Can you please help me out ?
I'm on Oracle 8.16.
Thank you,
Regards,
-H
Here's the example code given in Oracle Documentation:
PROCEDURE send_mail (sender IN VARCHAR2,
recipient IN VARCHAR2,
message IN VARCHAR2)
IS
mailhost VARCHAR2(30) := 'mail.mycompany.com';-- this is replaced
by correct domain
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);
END send_mail;
Sent via Deja.com
http://www.deja.com/
Received on Fri Dec 29 2000 - 16:13:46 CST
![]() |
![]() |