Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> UTL_SMTP problem
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;
(
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 );
REPLY := utl_smtp.command
(
c=>CONNECTION, cmd=>'MAIL FROM:', arg=>'fromname_at_domain.com' );
REPLY := utl_smtp.command
(
c=>CONNECTION, cmd=>'RCPT TO:', arg=>'toname_at_domain.com' );
REPLY := utl_smtp.command
(
c=>CONNECTION, cmd=>'QUIT', arg=>null );
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
![]() |
![]() |