Mail from Oracle procedure
Hi,
When i try to send the mail from Oracle procedure using procedure,I'm getting the following error,
SQL> exec send_mail_rahul('mit@ggn.com','mit@ggn.com','message');
BEGIN send_mail('mit@ggn.com','mit@ggn.com','message'); END;
*
ERROR at line 1:
ORA-29279: SMTP permanent error: 554 alpm01.e2k.ggn.com
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "CW.SEND_MAIL", line 8
ORA-06512: at line 1
Please find the procedure written for the same,
CREATE OR REPLACE PROCEDURE send_mail(p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_message IN VARCHAR2)
as
l_mailhost VARCHAR2(255) := 'alpm01.e2k.ggn.com';
l_mail_conn utl_smtp.connection;
BEGIN
l_mail_conn := utl_smtp.open_connection(l_mailhost,25);
utl_smtp.helo(l_mail_conn, l_mailhost);
utl_smtp.mail(l_mail_conn, p_sender);
utl_smtp.rcpt(l_mail_conn, p_recipient);
utl_smtp.open_data(l_mail_conn );
utl_smtp.write_data(l_mail_conn, p_message);
utl_smtp.close_data(l_mail_conn );
utl_smtp.quit(l_mail_conn);
end;
Kindly help me to resolve this error.Note: This mail server is working fine and SMTP is opened on port 25 only.
Thanks...