Home » SQL & PL/SQL » SQL & PL/SQL » Bad recipient address (oracle 10g , XP)
Bad recipient address [message #551583] Thu, 19 April 2012 08:55 Go to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
hi friends ,

i have a Procedure to Send mail [ i ll copied the code below ]

If i run procedure from my test database it works fine
while giving the recipient address as
xyz@gmail.com , temp@gmail.com [comma seperated mail address ]

if i run the same procedure from my client system it shows the error
'ORA -29279 :SMTP permanent error :501 5.1.3 Bad recipient address syntax'
it works fine while giving single recipient ex [xyz@gmail.com]

code for the procedure is
-----------
CREATE OR REPLACE PROCEDURE send_mail_test(p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
msg_cc1 varchar2,
p_message IN VARCHAR2,
p_subject IN VARCHAR2) AS
l_mailhost VARCHAR2(255) := 'xyxx.com';
l_mail_conn utl_smtp.connection;
ll_timeout PLS_INTEGER DEFAULT 15;
-- smtp_host VARCHAR2(256) := '192.168.35.203';
smtp_host VARCHAR2(256) := '192.168.45.12';
BEGIN

l_mail_conn := utl_smtp.open_connection(smtp_host, 25, ll_timeout);
utl_smtp.helo(l_mail_conn, l_mailhost);
utl_smtp.mail(l_mail_conn, p_sender);
utl_smtp.rcpt(l_mail_conn, p_recipient);
utl_smtp.rcpt(l_mail_conn, msg_cc1);
utl_smtp.open_data(l_mail_conn);
utl_smtp.write_data(l_mail_conn,
'From' || ': ' || p_sender || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn,
'To' || ': ' || p_recipient || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, 'CC' || ': ' || msg_cc1 || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn,
'Subject' || ': ' || p_subject || utl_tcp.crlf);

utl_smtp.write_data(l_mail_conn,
'Content-Type: text/html' || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, utl_tcp.crlf || p_message);

utl_smtp.close_data(l_mail_conn);
utl_smtp.quit(l_mail_conn);
END;
---
Re: Bad recipient address [message #551584 is a reply to message #551583] Thu, 19 April 2012 08:58 Go to previous messageGo to next message
BlackSwan
Messages: 22526
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Bad recipient address [message #551595 is a reply to message #551584] Thu, 19 April 2012 09:52 Go to previous messageGo to next message
ThomasG
Messages: 3089
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
RCPT TO accepts only ONE email address, not multiple ones. You have to call RCPT TO for each recipient.
Re: Bad recipient address [message #551640 is a reply to message #551595] Thu, 19 April 2012 22:57 Go to previous messageGo to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
OK I AGREE ,,
but how it runs Fine in my local Dabase..???

Re: Bad recipient address [message #551641 is a reply to message #551640] Thu, 19 April 2012 22:57 Go to previous messageGo to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
is there any option ???
Re: Bad recipient address [message #551642 is a reply to message #551641] Thu, 19 April 2012 23:04 Go to previous messageGo to next message
BlackSwan
Messages: 22526
Registered: January 2009
Senior Member
Does the question mark key on your keyboard have a problem?

>is there any option ???
Option to do what, exactly?

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Bad recipient address [message #551646 is a reply to message #551642] Thu, 19 April 2012 23:21 Go to previous messageGo to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
is there any other way to send mail [with comma separated recipient's]
for Example : xyz@gmail.com , temp@gmail.com [comma seperated mail address ]
Re: Bad recipient address [message #551647 is a reply to message #551646] Thu, 19 April 2012 23:27 Go to previous messageGo to next message
BlackSwan
Messages: 22526
Registered: January 2009
Senior Member
RCPT TO accepts only ONE email address, not multiple ones. You have to call RCPT TO for each recipient.

what part of above do you not understand?
Re: Bad recipient address [message #551649 is a reply to message #551647] Thu, 19 April 2012 23:32 Go to previous messageGo to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
if RCPT TO accepts only ONE email address then it throw the same error in local Db Too Right ??
but it Works Fine while giving Multiple recipient's [ comma seperated mail address ] in Local Database ???
Re: Bad recipient address [message #551748 is a reply to message #551649] Fri, 20 April 2012 07:32 Go to previous messageGo to next message
ThomasG
Messages: 3089
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
It has NOTHING to to with the database. It MIGHT be that the mail server (contrary to SMTP specification) accepts comma separated values in one case, and not in the other case.

It might of course also be that in the case that "seems to be working" the mail server just quietly drops the mails, while the other mail server returns an error message.

Again, it has NOTHING to do with the database or Oracle, the difference is on the MAIL SERVER side.

Re: Bad recipient address [message #551967 is a reply to message #551748] Mon, 23 April 2012 00:22 Go to previous messageGo to next message
ramnath1989
Messages: 48
Registered: November 2011
Location: india
Member
Thanks For the Help Friends,,
Problem Solved By calling RCPT TO for each recipient[ using Loops ]

if anybody needs the code Tell me ..,
I ll post the Code .





Re: Bad recipient address [message #551978 is a reply to message #551967] Mon, 23 April 2012 01:20 Go to previous message
Michel Cadot
Messages: 58612
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no need to ask, post the code is the default option.

Regards
Michel

[Updated on: Mon, 23 April 2012 01:22]

Report message to a moderator

Previous Topic: utl_mail unable to relay (2 threads merged by bb)
Next Topic: Problem with DBMS job scheduler
Goto Forum:
  


Current Time: Tue Jul 29 23:10:18 CDT 2014

Total time taken to generate the page: 0.08361 seconds