sending email using UTL_SMTP [message #362794] |
Thu, 04 December 2008 02:56 |
sandhyaa
Messages: 79 Registered: February 2007
|
Member |
|
|
Hi All,
I want to send email using UTL_SMTP. But when I try to execute the below statements, i get some error:
Error:
ERROR at line 1:
ORA-29278: SMTP transient error: 454 5.7.3 Client does not have permission to
submit mail to this server.
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 221
ORA-06512: at line 19
Code executed as sysdba:
Declare
SendorAddress Varchar2(200) := 'sender@myServer.com';
ReceiverAddress varchar2(200) := 'receiver@myServer.com';
EmailServer varchar2(200) := 'smtp.myServer.com';
Port number := 25;
conn UTL_SMTP.CONNECTION;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 4000 );
mesg_body varchar2(4000);
BEGIN
conn:= utl_smtp.open_connection( EmailServer, Port );
utl_smtp.helo( conn, EmailServer );
utl_smtp.mail( conn, SendorAddress);
utl_smtp.rcpt( conn, ReceiverAddress );
mesg:=
'Date: '||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' )|| crlf ||
'From:'||SendorAddress|| crlf ||
'Subject: Mail Through ORACLE Database' || crlf ||
'To: '||ReceiverAddress || crlf ||
'' || crlf ||
' This is Mail from Oracle Database By Using UTL_SMTP Package';
utl_smtp.data( conn, mesg );
utl_smtp.quit( conn );
END;
/
I am not sure what the issue is. I am trying to run in this in an AIX server. Do i need to give some permission? Please explain.
Thanks
Sandi
|
|
|
|
Re: sending email using UTL_SMTP [message #362866 is a reply to message #362802] |
Thu, 04 December 2008 06:14 |
Frank Naude
Messages: 4581 Registered: April 1998
|
Senior Member |
|
|
Like Michel said, the Oracle part is working fine, but smtp.myServer.com doesn't want to accept your mail. So, ask a sysadmin to open it up or use another SMTP server that will accept your mail.
Best of luck!
Frank
|
|
|