Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> UTL_TCP
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';--
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 messagebody
rc := utl_tcp.write_line(c, 'QUIT');
utl_tcp.close_connection(c); -- Close theconnection
We're using Oracle 8.1.7 on Sun 2.8. Any ideas ?
Thanks !
Regards,
Seb
http://MailAndNews.com
Create a new mailbox, or access your existing IMAP4 or POP3 mailbox from anywhere with just a web browser.