This content has been marked as final. Show 6 replies
I checked out the thread, but what I'm facing is a intermittent problem. Sometimes the utl_smtp call works, and other times it doesn't.
Assuming that you're always connecting to the same SMTP server, that implies that the SMTP server is intermittently down or unreachable (at least on the port you're using). Most likely, that would be an issue to address to the mail server admin though it could be an intermittent network issue.
am also facing same problem.
am calling as follows
CREATE OR REPLACE PROCEDURE send_mail (p_to IN VARCHAR2, p_from IN VARCHAR2, p_message IN VARCHAR2) AS l_mail_conn UTL_SMTP.connection; l_reply utl_smtp.reply; l_smtp_host VARCHAR2(50) := 'smtp.gmail.com:25'; l_smtp_port NUMBER := 25; BEGIN l_mail_conn := UTL_SMTP.open_connection(l_smtp_host, l_smtp_port); utl_smtp.EHLO(l_mail_conn, l_smtp_host); utl_smtp.command(l_mail_conn, 'AUTH LOGIN'); utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('firstname.lastname@example.org')))); utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('mypwd')))); l_reply :=UTL_SMTP.mail(l_mail_conn, p_from); dbms_output.put_line( l_reply.code || ' ' || l_reply.text ); UTL_SMTP.rcpt(l_mail_conn, p_to); UTL_SMTP.write_data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf); UTL_SMTP.quit(l_mail_conn); END; /
and getting the error
declare conn utl_smtp.connection; smtp_domain VARCHAR2(256) := null; BEGIN utl_smtp.command(conn,'STARTTLS'); utl_smtp.helo(conn, smtp_domain); send_mail(p_to => 'email@example.com', p_from => 'firstname.lastname@example.org', p_message => 'can i get message.'); END; /
i have checked in control panel that IIS is installed and SMTP is also setup.
ORA-29278: SMTP transient error: 421 Service not available ORA-06512: at "SYS.UTL_SMTP", line 21 ORA-06512: at "SYS.UTL_SMTP", line 97 ORA-06512: at "SYS.UTL_SMTP", line 159 ORA-06512: at line 5
i am able to ping SMTP HOST thro' TELNET
and i have changed the SMTP_OUT_SERVER parameter like
am not getting any clue. is it because of using GMAIL server?
ALTER SYSTEM SET SMTP_OUT_SERVER= 'smtp.gmail.com:25' scope = both
oracle version 10g and Windows is XP - SP3
thank you for any help
what worked for me is to change this code:
V_mail_conn := UTL_SMTP.open_connection ('smtp.ufl.edu', 25);
UTL_SMTP.helo (V_mail_conn, 'smtp.ufl.edu');
to this code:
V_mail_conn := UTL_SMTP.open_connection ('localhost', 25);
UTL_SMTP.helo (V_mail_conn, 'localhost');
evidently if the smtp is busy there is no queueing but there is with local
When we try to attach file by using UTL_SMTP function and file size is larger , then also the SMTP connection goes down and database too , it also generate same type of error.