Re: ORA-20002: 501 Bad address syntax

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Thu, 24 Apr 2003 16:26:15 GMT
Message-ID: <MPG.1911b004353ed0fa989755_at_news.la.sbcglobal.net>


schumacherfan2003_at_yahoo.com said...
> Hi,
>
> I intend to send a simple smtp mail using the builtin UTL_SMTP package.
>
> But i get the following error:-
> ORA-20002: 501 Bad syntax error
>
> Here is my code:-
> CREATE OR REPLACE PROCEDURE mail
> IS
> BEGIN
> DECLARE
> v_connection UTL_SMTP.CONNECTION;
>
> BEGIN v_connection := UTL_SMTP.OPEN_CONNECTION(<my host here>,25);
> dbms_output.put_line('Connection Opened');
>
> UTL_SMTP.HELO(v_connection,<my host here>);
> dbms_output.put_line('After calling helo');
>
> UTL_SMTP.MAIL(v_connection,'test_at_myhost.com');
> dbms_output.put_line('Sender set');
>
> UTL_SMTP.RCPT(v_connection,'test1_at_myhost.com');
> dbms_output.put_line('Recipient Set');
>
> UTL_SMTP.DATA(v_connection,'Sent From PL/SQL');
> dbms_output.put_line('Message body set');
>
> UTL_SMTP.QUIT(v_connection);
> dbms_output.put_line('Connection Closed');
> end;
> END;
> /
>
> Here is the output:-
>
> SQL> exec mail
> Connection Opened
> After calling helo
> BEGIN mail; END;
>
> *
> ERROR at line 1:
> ORA-20002: 501 Bad address syntax
> ORA-06512: at "SYS.UTL_SMTP", line 86
> ORA-06512: at "SYS.UTL_SMTP", line 204
> ORA-06512: at "ADMIN.MAIL", line 13
> ORA-06512: at line 1
>
>
> I tried sending mails to my smtp server via java mailing API and i am
> successful. So i am wondering wat i am doing wrong up there in Oracle.
> I have JServer enabled, i also ran the initplsj.sql successfully.
>
> Please help.
> Regards,
> Leo.
>
Don't know whether or not you've looked at Tom Kyte's site yet, but he has a lengthy discussion of UTL_SMTP ... see (will wrap):

http://asktom.oracle.com/pls/ask/f?p=4950:8:1090762::NO::F4950_P8 _DISPLAYID,F4950_P8_CRITERIA:255615160805, or just go to the asktom site and search for utl_smtp. Tom is usually a good resource to check when you run into these baffling scenarios.

-- 
/Karsten
DBA > retired > DBA
Received on Thu Apr 24 2003 - 18:26:15 CEST

Original text of this message