Home » SQL & PL/SQL » SQL & PL/SQL » UTL SMTP ORA-29278: SMTP transient error: (Oracle 11g, Windows 7 Operating system)
UTL SMTP ORA-29278: SMTP transient error: [message #514195] Sat, 02 July 2011 10:38 Go to next message
ninan
Messages: 163
Registered: June 2011
Location: Noida
Senior Member
Intention is to run the UTL_SMTP and send a mail to my mail
id in gmail. Host used is localhost.

Oracle version is 11g

Since my machine is running on Windows 7 and since SMTP server is no more part of IIS, I have not configured any SMTP server for the Operating system.

When I run the plsql block , I get the error.

ORA-29278: SMTP transient error: 421 Service not available

Please see the code below. Am I Missing something. Did a lot of search on google and thise forum, and found lot of posts on the same error, none of them is having a solution, some of them was suggesting the SMTP SERVER configuration in Operating system level. Can anyone help me and suggest what I am missing.

I created the acl list and assigned acls

--Creating acls


begin 

  dbms_network_acl_admin.create_acl (  

    acl         => 'utl_smtp.xml',  

    description => 'Allow mail to be send',  

    principal   => 'SIDNEY',  

    is_grant    => TRUE,  

    privilege   => 'connect' 

    );  

    commit;  

end;

--- Adding acl privilege

begin 

  dbms_network_acl_admin.add_privilege (  

  acl       => 'utl_smtp.xml',  

  principal => 'SIDNEY',  

  is_grant  => TRUE,  

  privilege => 'resolve' 

  );  

  commit;  

end;

-- Assign acls

SQL> begin
  2
  3    dbms_network_acl_admin.assign_acl(
  4
  5    acl  => 'utl_smtp.xml',
  6
  7    host => 'localhost'
  8
  9    );
 10
 11    commit;
 12
 13  end;
 14  /

PL/SQL procedure successfully completed.

SQL> begin
  2
  3    dbms_network_acl_admin.assign_acl(
  4
  5    acl  => 'utl_http.xml',
  6
  7    host => 'localhost'
  8
  9    );
 10
 11    commit;
 12
 13  end;
 14  /

PL/SQL procedure successfully completed.

---- PL/SQL Block for sending mail using UTL_SMTP

SQL> declare
  2  v_fromaddr varchar2(50):='Oracle';
  3  v_toaddr varchar2(50) := 'nirmalnarayanans@gmail.com';
  4  v_message varchar2(200);
  5
  6  v_mailhost varchar2(50) := 'localhost';
  7  v_mailconn UTL_SMTP.connection;
  8
  9  Begin
 10  v_message :=
 11  'From ' || v_fromaddr || CHR(10) ||
 12  'Subject : Hello from PL/SQK ' || CHR(10) || ' Sent by UTL_SMTP ';
 13  v_mailconn := UTL_SMTP.OPEN_CONNECTION(v_mailhost);
 14
 15  UTL_SMTP.HELO(v_mailconn, v_mailhost);
 16  utl_smtp.command(v_mailconn ,'STARTTLS');
 17  UTL_SMTP.MAIL(v_mailconn, v_fromaddr);
 18  UTL_SMTP.RCPT(v_mailconn, v_toaddr);
 19  UTL_SMTP.DATA(v_mailconn, v_message);
 20  UTL_SMTP.QUIT(v_mailconn);
 21
 22  END;
 23  /
declare
*
ERROR at line 1:
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 29
ORA-06512: at "SYS.UTL_SMTP", line 108
ORA-06512: at "SYS.UTL_SMTP", line 150
ORA-06512: at line 13



Many thanks in Advance
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514199 is a reply to message #514195] Sat, 02 July 2011 10:46 Go to previous messageGo to next message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This has nothing with Oracle just you have no SMTP server.
Oracle provides the access to a SMTP server, it does not provide the SMTP server.

Regards
Michel

[Updated on: Sat, 02 July 2011 10:49]

Report message to a moderator

Re: UTL SMTP ORA-29278: SMTP transient error: [message #514207 is a reply to message #514199] Sat, 02 July 2011 11:15 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>id in gmail. Host used is localhost.
LOCALHOST can only ever talk to itself.

http://en.wikipedia.org/wiki/Localhost
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514208 is a reply to message #514199] Sat, 02 July 2011 11:18 Go to previous messageGo to next message
ninan
Messages: 163
Registered: June 2011
Location: Noida
Senior Member
I understand that "Host is for the sender" not for recipient ?

I said Windows 7 does'nt come with SMTP Server.

Anyone with experience working in Windows 7, have used UTL_SMTP. ?

Are you saying this needs some configuration on OS level, ?

Re: UTL SMTP ORA-29278: SMTP transient error: [message #514209 is a reply to message #514208] Sat, 02 July 2011 11:52 Go to previous messageGo to next message
ninan
Messages: 163
Registered: June 2011
Location: Noida
Senior Member
Is it possible to create an SMTP server in ORACLE. I am not sure how to install SMTP Server in Windows 7. There is no option like SMTP Email in IIS
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514210 is a reply to message #514209] Sat, 02 July 2011 11:56 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Is it possible to create an SMTP server in ORACLE. I am not sure how to install SMTP Server in Windows 7. There is no option like SMTP Email in IIS
The Windows Mail Server software is called Microsoft Exchange; which extra cost utility & non-trivial to configure.
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514211 is a reply to message #514210] Sat, 02 July 2011 11:58 Go to previous messageGo to next message
ninan
Messages: 163
Registered: June 2011
Location: Noida
Senior Member
Ok. Thanks for the reply. So what is the alternative you suggest ? Or there is no alternative ? What about Oracle Mail Server ?
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514212 is a reply to message #514211] Sat, 02 July 2011 12:01 Go to previous messageGo to next message
ninan
Messages: 163
Registered: June 2011
Location: Noida
Senior Member
I think downgrading from Windows 7 to Windows 2000 or XP may help. Or even Linux may be a good option. No Extra costs.

"I bought a CAR, but it comes without wheels." kinda situation.
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514213 is a reply to message #514211] Sat, 02 July 2011 12:02 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Ok. Thanks for the reply. So what is the alternative you suggest ?
A handful of free alternatives exist in the *NIX world.

>Or there is no alternative ?
send SMS via Web/HTTP interface

>What about Oracle Mail Server ?
Does this still exist?
I have NO experience with this.
Re: UTL SMTP ORA-29278: SMTP transient error: [message #514226 is a reply to message #514209] Sat, 02 July 2011 13:29 Go to previous message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I have used BLAT for years. It is free ad easy to use.

Regards
Michel
Previous Topic: list of second and forth saturday in a perticular year
Next Topic: SQL Query - Doubt
Goto Forum:
  


Current Time: Tue Apr 23 12:17:59 CDT 2024