Home » SQL & PL/SQL » SQL & PL/SQL » ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available (oracle form)
ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589817] Thu, 11 July 2013 01:39 Go to next message
shanker86
Messages: 5
Registered: July 2013
Location: KL,MALAYSIA
Junior Member

i want do email notification. i create procedure without error. when i declare i gettingt error.
please help me on this.

procedure
CREATE OR REPLACE PROCEDURE send_mail (p_to IN VARCHAR2,
p_from IN VARCHAR2,
p_message IN VARCHAR2,
p_smtp_host IN VARCHAR2,
p_smtp_port IN NUMBER DEFAULT 25)
AS
l_mail_conn UTL_SMTP.connection;
BEGIN
l_mail_conn := UTL_SMTP.open_connection (p_smtp_host, '25');
UTL_SMTP.helo (l_mail_conn, p_smtp_host);
UTL_SMTP.mail (l_mail_conn, p_from);
UTL_SMTP.rcpt (l_mail_conn, p_to);
UTL_SMTP.data (l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
UTL_SMTP.quit (l_mail_conn);
EXCEPTION
WHEN UTL_SMTP.Transient_Error OR UTL_SMTP.Permanent_Error
THEN
raise_application_error (-20000, 'Unable to send mail: ' || SQLERRM);
END;
/

*********************************************************************************

DECLARE
P_TO VARCHAR2(32767);
P_FROM VARCHAR2(32767);
P_MESSAGE VARCHAR2(32767);
P_SMTP_HOST VARCHAR2(32767);
P_SMTP_PORT NUMBER;

BEGIN
P_TO := 'shanker.tamarasan@allianz.com.my';
P_FROM := 'cits.support@allianz.com.my';
P_MESSAGE := 'Test Email';
P_SMTP_HOST := 'mail.allianz.com.my';
P_SMTP_PORT := 25;

SEND_MAIL ( P_TO, P_FROM, P_MESSAGE, P_SMTP_HOST, P_SMTP_PORT );
COMMIT;
END;
/

i getting below error:
ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "CUSTOMER.SEND_MAIL", line 18
ORA-06512: at line 15

please help....
Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589820 is a reply to message #589817] Thu, 11 July 2013 02:16 Go to previous messageGo to next message
John Watson
Messages: 4400
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and PLEASE read How to use [code] tags and make your code easier to read

It looks to me as though you have the wrong address for your mail sever. It doesn't respond. Look at this:
c:\users\john>nslookup mail.allianz.com.my
Server:  BThomehub.home
Address:  192.168.1.254

Non-authoritative answer:
Name:    mail.allianz.com.my
Address:  111.67.35.40


c:\users\john>telnet mail.allianz.com.my 25
Connecting To mail.allianz.com.my...Could not open connection to the host, on port 25: Connect failed

c:\users\john>
c:\users\john>

--
update: sorry, not "address", I meant "port".

[Updated on: Thu, 11 July 2013 02:18]

Report message to a moderator

Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589924 is a reply to message #589820] Fri, 12 July 2013 01:52 Go to previous messageGo to next message
shanker86
Messages: 5
Registered: July 2013
Location: KL,MALAYSIA
Junior Member

sorry for wrong information

SMTP HOST = ms1.mbadomain.allianz.my
SMTP PORT = 25

Please help on this
Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589925 is a reply to message #589924] Fri, 12 July 2013 01:55 Go to previous messageGo to next message
John Watson
Messages: 4400
Registered: January 2010
Location: Global Village
Senior Member
I've already shown you a very simple test that you need to run.
Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589927 is a reply to message #589925] Fri, 12 July 2013 02:18 Go to previous messageGo to next message
shanker86
Messages: 5
Registered: July 2013
Location: KL,MALAYSIA
Junior Member

Hi,

I getting below error:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\shanker.tamarasan>nslookup ms1.mbadomain.allianz.my
Server: ghq-ads01p-p.my.allianz.dir
Address: 10.100.60.90

Non-authoritative answer:
Name: ms1.mbadomain.allianz.my
Address: 10.100.51.53


C:\Users\shanker.tamarasan>telnet ms1.mbadomain.allianz.my 25
'telnet' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\shanker.tamarasan>

Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589931 is a reply to message #589927] Fri, 12 July 2013 03:05 Go to previous messageGo to next message
Michel Cadot
Messages: 58610
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
'telnet' is not recognized as an internal or external command,


And now you are just waiting we give you how to fix that?
What about Googling on "windows telnet"?
We are not here to spoonfeed you.
We are expecting you'd activate what should be between your ears.

Regards
Michel

Re: ORA-20000: Unable to send mail: ORA-29278: SMTP transient error: 421 Service not available [message #589933 is a reply to message #589931] Fri, 12 July 2013 04:02 Go to previous message
shanker86
Messages: 5
Registered: July 2013
Location: KL,MALAYSIA
Junior Member

sorry for disturb. this is first time i do this. sorry again.
Previous Topic: Different between varchar2(n bytes) and varchar2(n char)?
Next Topic: Creating PLSQL Collection Table type with dynamic query
Goto Forum:
  


Current Time: Tue Jul 29 10:36:50 CDT 2014

Total time taken to generate the page: 0.08484 seconds