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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Problems, to get utlsmtp up and running

Re: Problems, to get utlsmtp up and running

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 26 Jan 2003 13:11:15 -0800
Message-ID: <b11itj0t3o@drn.newsguy.com>


In article <62e59750.0301261242.5416570b_at_posting.google.com>, oliver_at_demus-online.de says...
>
>Newbie needs some help:
>

remove the when others which is undoubtably HIDING the error from you.

999 time out of 1000 when yousee a "when others" that is not followed by "raise", you are looking squarely at a "bug"

just delete these lines:

>
>EXCEPTION
>WHEN OTHERS THEN
>dbms_output.put_line(sqlerrm);

and try again -- you'll be surprised maybe.

>I am running Oracle 8.1.7 on WIN2000
>
>I did the following:
>Installed $ORACLE_HOME/javavm/install/initjvm.sql
>then $ORACLE_HOME/rdbms/admin/initplsj.sql
>after that the utlsmtp.sql
>
>Then I restarted the database and run the following with the command
>exec send_mail3;
>
>create or replace PROCEDURE SEND_MAIL3
> is
>
>crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 );
>mesg VARCHAR2(4000);
>mail_conn UTL_SMTP.CONNECTION;
>cc_recipient VARCHAR2(50) default 'email-address';
>
>BEGIN
>
>mail_conn := utl_smtp.open_connection('smtp.webaddress.de, 25);
>
>utl_smtp.helo(mail_conn, 'webaddress.de');
>utl_smtp.mail(mail_conn, 'email-address');
>utl_smtp.rcpt(mail_conn, 'email-address');
>utl_smtp.rcpt(mail_conn, 'email-address');
>
>mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf
>||
>'From: ' || 'email-address'|| crlf ||
>'To: ' || 'email-address'|| crlf ||
>'Cc: ' || 'email-address'|| crlf ||
>--'Bcc: ' || bcc_recipient || crlf ||
>'Subject: ' || 'Test Subject' || crlf;
>mesg:= mesg || '' || crlf || 'Bodytext';
>
>utl_smtp.data(mail_conn, mesg);
>utl_smtp.quit(mail_conn);
>
>EXCEPTION
>WHEN OTHERS THEN
>dbms_output.put_line(sqlerrm);
>
>END;
>/
>
>This returns with: PL/SQL procedure successfully completed.
>But I recieved no email, do I have to make an entry in the init.ora?
>
>Can anybody help?

--
Thomas Kyte (tkyte@oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sun Jan 26 2003 - 15:11:15 CST

Original text of this message

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