Home » RDBMS Server » Server Administration » sending email using UTL_SMTP (9.2.0.6)
sending email using UTL_SMTP [message #362794] Thu, 04 December 2008 02:56 Go to next message
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 #362802 is a reply to message #362794] Thu, 04 December 2008 03:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is not an Oracle error but one from your SMTP server.
So ask your sysadmin.

Regards
Michel
Re: sending email using UTL_SMTP [message #362866 is a reply to message #362802] Thu, 04 December 2008 06:14 Go to previous message
Frank Naude
Messages: 4502
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
Previous Topic: reclaim unused space for partitioned tables
Next Topic: objects reassign?
Goto Forum:
  


Current Time: Sat Dec 10 10:50:50 CST 2016

Total time taken to generate the page: 0.17365 seconds