Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Sending Email from Server - please help !

Re: Sending Email from Server - please help !

From: Klaus Zeuch <KZeuch_at_hotmail.com>
Date: Sat, 30 Dec 2000 00:53:38 +0100
Message-ID: <92j88d$b63$01$1@news.t-online.com>

Hi,

did you install the oracle java virtual machine (utl_smtp is just a wrapper around java classes)? If yes, please check Oracle metalink for that error message - there are errors in the Oracle installation scripts. Look also for working utl_smtp examples in metalink - the online documents are not sufficient.

Klaus

<hnene_at_my-deja.com> schrieb im Newsbeitrag news:92j2al$2qi$1_at_nnrp1.deja.com...
>
>
> 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 :
>
> ----------------------------------------------
> ERROR at line 1:
> 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 - 17:53:38 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US