UTL SMTP ORA-29278: SMTP transient error: [message #514195] |
Sat, 02 July 2011 10:38 |
|
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
|
|
|
|
|
|
|
|
|
|
|
|