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

Home -> Community -> Usenet -> c.d.o.server -> UTL_SMTP problem

UTL_SMTP problem

From: <lofftjm_at_itec.mail.suny.edu>
Date: 2000/07/03
Message-ID: <8jqstf$39t$1@nnrp1.deja.com>#1/1

I am having a problem with the UTL_SMTP package. I amtrying to send email from my NT desktop 8.1.6 database to our NT Exchange Server.

I have the following procedure in place and it seems to be working:

procedure MAIL
is

  CONNECTION      UTL_SMTP.CONNECTION;
  REPLY           UTL_SMTP.REPLY;

  END_OF_MESSAGE varchar2(10);
begin
  END_OF_MESSAGE := CHR(13)||'.'||CHR(13);   REPLY := utl_smtp.open_connection

(

              host=>'mail.domain.com
              port=>25,
              c=>CONNECTION
             );
  dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);
  dbms_output.put_line('Connection host: '||CONNECTION.host);   dbms_output.put_line('Connection port: '||CONNECTION.port);

  REPLY := utl_smtp.command

(

              c=>CONNECTION,
              cmd=>'HELO',
              arg=>null
             );

  dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);

  REPLY := utl_smtp.command

(

              c=>CONNECTION,
              cmd=>'MAIL FROM:',
              arg=>'fromname_at_domain.com'
             );

  dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);

  REPLY := utl_smtp.command

(

              c=>CONNECTION,
              cmd=>'RCPT TO:',
              arg=>'toname_at_domain.com'
             );

  dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);

  REPLY := utl_smtp.command

(

              c=>CONNECTION,
              cmd=>'QUIT',
              arg=>null
             );

  dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);

end MAIL;

When I execute this through SQLPLUS the output is as follows:

SQL> execute mail;
Reply: 220 -- mail.domain.com ESMTP Server (Microsoft Exchange Internet Mail Service 5.5.2448.0) ready
Connection host: mail.domain.com
Connection port: 25

Reply: 250 -- OK
Reply: 250 -- OK - mail from <fromname_at_domain.com>
Reply: 250 -- OK - Recipient <toname_at_domain.com>
Reply: 221 -- closing connection

PL/SQL procedure successfully completed.

The problem arrises when I try to add the following after RCPT TO command:

REPLY := utl_smtp.command(c=>CONNECTION,cmd=>'DATA',arg=>'This is the message body!'||END_OF_MESSAGE);
dbms_output.put_line('Reply: '||REPLY.code||' -- '||REPLY.text);

When these lines are added and I execute the procedure, SQL*Plus stops responding and I have to
restart the database/listener to return to normal.

I'm not sure how to diagnose this. Any suggestions?

joe.lofft_at_itec.mail.suny.edu

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Jul 03 2000 - 00:00:00 CDT

Original text of this message

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