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: UTL_TCP

Re: UTL_TCP

From: ggarriso <ggarrisonsr1_at_hotmail.com>
Date: Fri, 11 May 2001 01:28:31 GMT
Message-ID: <3fHK6.16035$t12.1237880@bgtnsc05-news.ops.worldnet.att.net>

In your experiments have you determined how to maintian a connection to a local socket/port for constant reading?

Appreciated.

"Sébastien Rigaud" <spendius_at_MailAndNews.com> wrote in message news:3AFA1863_at_MailAndNews.com...
> Does it properly work ? Because I've experienced locked sessions
> EVERY TIME I send a mail thru our mail server, when using this
> package (I can see in V$ACCESS tens or hundreds of records related
> to my session, which hangs forever, and to the Java cursors and
> classes -owned by SYS- used by this package)...
>
> I found the code I use somewhere on the web, here it is:
> declare
> msg_from VARCHAR2(11) := 'scperf_at_WW3D';
> --msg_to VARCHAR2;
> msg_to varchar2(30) := 'myLogin_at_ourDomain';
> msg_subject VARCHAR2(33) := 'E-Mail message from your database';
> msg_text VARCHAR2(31) := 'Test de mail a partir de PL/SQL';
> --
> c utl_tcp.connection;
> rc INTEGER;
> BEGIN
>
> c := utl_tcp.open_connection('<our mail server IP>', 25);
>
> rc := utl_tcp.write_line(c, 'HELO localhost');
>
> rc := utl_tcp.write_line(c, 'MAIL FROM: '||msg_from);
>
> rc := utl_tcp.write_line(c, 'RCPT TO: '||msg_to);
>
> rc := utl_tcp.write_line(c, 'DATA'); -- Start message
 body
>
> rc := utl_tcp.write_line(c, 'Subject: '||msg_subject);
> rc := utl_tcp.write_line(c, '');
> rc := utl_tcp.write_line(c, msg_text);
> rc := utl_tcp.write_line(c, '.'); -- End of message
> body
>
> rc := utl_tcp.write_line(c, 'QUIT');
>
> utl_tcp.close_connection(c); -- Close the
> connection
> EXCEPTION
> WHEN OTHERS THEN
> raise_application_error(-20000, 'Unable to send mail message from
> pl/sql');
> END;
> /
>
> We're using Oracle 8.1.7 on Sun 2.8. Any ideas ?
>
> Thanks !
> Regards,
> Seb
>
> ------------------------------------------------------------
> Get your FREE web-based e-mail and newsgroup access at:
> http://MailAndNews.com
>
> Create a new mailbox, or access your existing IMAP4 or
> POP3 mailbox from anywhere with just a web browser.
> ------------------------------------------------------------
>
Received on Thu May 10 2001 - 20:28:31 CDT

Original text of this message

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