Home » SQL & PL/SQL » SQL & PL/SQL » error:service not avail
error:service not avail [message #219185] Tue, 13 February 2007 09:22 Go to next message
SRIVASUWIN
Messages: 45
Registered: October 2006
Location: TRICHY
Member
hello sir,

Plz help me....

I have a procedure to send mail from my server to mail.x.com(my office website) it works fine but the actual problem is that procedure works for our company website only not for others now i need to send mail to gmail account so that i changed the following line from the procedure:

mailsrvr varchar2(50) := 'mail.x.com';--->into

mailsrvr varchar2(50) := 'smpt.gmail.com';


when i am exec this procedure it shows error:

ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "TCMS_DATA.SEND_MAIL", line 8
ORA-06512: at line 2

My procedure(send_mail):

create or replace procedure mails (
sender in varchar2,
recipient in varchar2,
carbon_copies in varchar2,
bcc in varchar2,
mail_subject in varchar2,
mail_body in clob)
as
conntype utl_smtp.connection;
mailsrvr varchar2(50) := 'mail.X.com';
svrport varchar2(3) :=25;
svrdate varchar2(255) := to_char( SYSDATE,'dd Mon yy hh24:mi:ss' );
msghdr varchar2(2000) := NULL;
linefeed varchar(2) := chr(13)||chr(10);
msgbody clob;
begin
conntype := utl_smtp.open_connection (mailsrvr,svrport);
msghdr := 'Date: ' || svrdate || linefeed ||
'From: <' || sender || '>' || linefeed ||
'Subject: ' || mail_subject || linefeed ||
'To: ' || recipient || linefeed ||
'Cc: '|| carbon_copies || linefeed ||
'Bcc: '|| bcc || linefeed ||
'' || linefeed;


msgbody := msghdr || mail_body;
utl_smtp.helo(conntype, mailsrvr);
utl_smtp.mail(conntype, sender);
utl_smtp.rcpt(conntype, recipient);
utl_smtp.rcpt(conntype, carbon_copies);
utl_smtp.rcpt(conntype, bcc);
utl_smtp.data(conntype, msgbody);
utl_smtp.quit(conntype);
end;
/


plz help me sir
-Thanx

Re: error:service not avail [message #219208 is a reply to message #219185] Tue, 13 February 2007 10:14 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
>now i need to send mail to gmail account so that i changed the following line from the procedure:
>mailsrvr varchar2(50) := 'mail.x.com';--->into
>mailsrvr varchar2(50) := 'smpt.gmail.com';
WHY??????????
You should continue to use YOUR mailserver;
just change "recipient" on the "To:" line.

Re: error:service not avail [message #219221 is a reply to message #219208] Tue, 13 February 2007 10:43 Go to previous message
SRIVASUWIN
Messages: 45
Registered: October 2006
Location: TRICHY
Member
thank u sir.
Previous Topic: Return just one value
Next Topic: Unhandled user Exception- except handled
Goto Forum:
  


Current Time: Fri Dec 02 18:29:42 CST 2016

Total time taken to generate the page: 0.07137 seconds