SMTP permanent error: 554 5.7.1
kknrMay 22 2012 — edited May 22 2012Hi all,
we are using the oracle database 10g
from the data basewe are trying to send the e-mail using util package it is working fine for the same domain . while we tried to send gmail or different other domains it's giving the following error .
ORA-29279: SMTP permanent error: 554 5.7.1 <nag@hydroline.com>: Relay access denied
can anybody help me ow to resolve this,
thank you.
this is the procedure we are using
=========================
CREATE OR REPLACE PROCEDURE mailout
(
sender IN VARCHAR2,
recipient IN VARCHAR2,
subject IN VARCHAR2,
cont_person IN VARCHAR2,
ls_msg1 in varchar2
)IS
crlf VARCHAR2(2):= UTL_TCP.CRLF;
connection utl_smtp.connection;
mailhost VARCHAR2(30) := '192.168.1.35';
header VARCHAR2(1000);
msg_line VARCHAR2(1000);
message varchar2(4000);
BEGIN
--
-- Start the connection.
--
connection := utl_smtp.open_connection('192.168.1.35',25);
header := 'Date: '||TO_CHAR(SYSDATE,'dd Mon yy hh24:mi:ss')||crlf||
'From: '||sender||''||crlf||
'Subject: '||subject||crlf||
'To: '||recipient||crlf;
message := 'Dear All,'||CRLF||
' '||CRLF||
ls_msg1||CRLF||
' '||CRLF||
' '||CRLF||
' '||CRLF||
'Best Regards'||CRLF||
'k.k.nagaraju';
--
-- Handshake with the SMTP server
--
utl_smtp.helo(connection, mailhost);
utl_smtp.mail(connection, sender);
utl_smtp.rcpt(connection, recipient);
utl_smtp.open_data(connection);
--
-- Write the header
--
utl_smtp.write_data(connection, header);
utl_smtp.write_data(connection, crlf ||message);
-- The crlf is required to distinguish that what comes next is not simply part of the header.
utl_smtp.close_data(connection);
utl_smtp.quit(connection);
EXCEPTION
WHEN UTL_SMTP.INVALID_OPERATION THEN
dbms_output.put_line('1-'||SQLERRM);
WHEN UTL_SMTP.TRANSIENT_ERROR THEN
dbms_output.put_line('2-'||SQLERRM);
WHEN UTL_SMTP.PERMANENT_ERROR THEN
dbms_output.put_line('3-'||SQLERRM);
END;