1 Reply Latest reply: Sep 6, 2013 5:04 AM by user11165897 RSS

    SMTP service not available

    user11165897
      Hi,

      How to send mail through the following code ?

      CREATE OR REPLACE PROCEDURE send_mail (p_to IN VARCHAR2,
      p_from IN VARCHAR2,
      p_message IN VARCHAR2,
      p_smtp_host IN VARCHAR2,
      p_smtp_port IN NUMBER DEFAULT 25)
      AS
      l_mail_conn sys.UTL_SMTP.connection;
      BEGIN
      l_mail_conn := sys.UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
      sys.UTL_SMTP.helo(l_mail_conn, p_smtp_host);
      sys.UTL_SMTP.mail(l_mail_conn, p_from);
      sys.UTL_SMTP.rcpt(l_mail_conn, p_to);
      sys.UTL_SMTP.data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      sys.UTL_SMTP.quit(l_mail_conn);
      END;
      /


      BEGIN
      send_mail(p_to => 'a@gmail.com',
      p_from => 'bi@gmail.com',
      p_message => 'This is a test message.',
      p_smtp_host => 'mail.google.com');
      END;
      /


      ERROR:

      ORA-29278: SMTP transient error: 421 Service not available
      ORA-06512: at "SYS.UTL_SMTP", line 20
      ORA-06512: at "SYS.UTL_SMTP", line 96
      ORA-06512: at "SYS.UTL_SMTP", line 138
      ORA-06512: at "APPS.SEND_MAIL", line 9
      ORA-06512: at line 2


      Please help me to get through the error.


      Thanks in advance ,
      Pradeep

      Edited by: user11165897 on Dec 7, 2012 2:27 AM