Home » SQL & PL/SQL » SQL & PL/SQL » ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax (Oracle Applications R12.1.3 / RDBMS : 11.2.0.1.0)
icon5.gif  ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568887] Wed, 17 October 2012 07:17 Go to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
Hello All,

I am Facing an Error as below while trying to Execute a Developed EMAIL Trigger in DB :

ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax

I am totally surprised as i have checked both the addresses : Sender as well as Receivers..

My Senders Address is : 'rajesh@maxmsp.com'
and Receivers Address is : 'deepak-arora@hcl.com'

Any Help related to it will be highly appreciated..

Regards,
Deepak

[Updated on: Wed, 17 October 2012 07:18]

Report message to a moderator

Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568891 is a reply to message #568887] Wed, 17 October 2012 07:30 Go to previous messageGo to next message
cookiemonster
Messages: 13975
Registered: September 2008
Location: Rainy Manchester
Senior Member
Looks like the error is originating on the mail server and oracle is merely reporting it.
I suggest you talk to whoever is in charge of the mail server.
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568893 is a reply to message #568887] Wed, 17 October 2012 07:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68773
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
' is part or not of your address?
I will tend to believe the error message and advice you to double or trible check, you have an error in your code.

Regards
Michel
icon9.gif  Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568899 is a reply to message #568893] Wed, 17 October 2012 07:36 Go to previous messageGo to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member

' is just to pass the string to the variable

and all mails are working fine but while mailing it from DB it is returning this error..

Even not able to find any solution for it anywhere on Internet..
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568900 is a reply to message #568899] Wed, 17 October 2012 07:37 Go to previous messageGo to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
I am using the below script for better understanding :
CREATE OR REPLACE PROCEDURE TESTMAIL(fromm VARCHAR2,too VARCHAR2,sub VARCHAR2,body VARCHAR2,port NUMBER)
IS
objConnection UTL_SMTP.CONNECTION;
vrData VARCHAR2(32000);
BEGIN
objConnection := UTL_SMTP.OPEN_CONNECTION('mail.maxmsp.com',PORT);
UTL_SMTP.HELO(objConnection, 'mail.maxmsp.com');
UTL_SMTP.MAIL(objConnection, fromm);
UTL_SMTP.RCPT(objConnection, too);
UTL_SMTP.OPEN_DATA(objConnection);

UTL_SMTP.WRITE_DATA(objConnection, 'From: '||fromm || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'To: '||too || UTL_TCP.CRLF);

UTL_SMTP.WRITE_DATA(objConnection, 'Subject: ' || sub || UTL_tcp.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'MIME-Version: ' || '1.0' || UTL_tcp.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'Content-Type: ' || 'text/html;');

UTL_SMTP.WRITE_DATA(objConnection, 'Content-Transfer-Encoding: ' || '"8Bit"' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<HTML>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<BODY>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<FONT COLOR="red" FACE="Courier New">'||body||'</FONT>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</BODY>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</HTML>');
UTL_SMTP.CLOSE_DATA(objConnection);
UTL_SMTP.QUIT(objConnection);
EXCEPTION
WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
UTL_SMTP.QUIT(objConnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
WHEN OTHERS THEN
UTL_SMTP.QUIT(objconnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END TESTMAIL;
/


DECLARE
Vdate Varchar2(25);
BEGIN
Vdate := to_char(sysdate,'dd-mon-yyyy HH:MI:SS AM');
TESTMAIL('rajesh@maxmsp.com', 'deepak3arora@gmail.com', 'TESTMAIL','This is a UTL_SMTP-generated email at '|| Vdate,25);
END;

[Updated on: Wed, 17 October 2012 07:38]

Report message to a moderator

Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568904 is a reply to message #568900] Wed, 17 October 2012 08:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68773
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use UTL_MAIL and not UTL_SMTP then you will be sure that the header is well-formed.

Regards
Michel
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568905 is a reply to message #568904] Wed, 17 October 2012 08:08 Go to previous messageGo to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
UTL_MAIL also reverting same Error :
ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568908 is a reply to message #568905] Wed, 17 October 2012 08:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68773
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Copy and paste your code and its execution.

Before, Please How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.


Regards
Michel
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568946 is a reply to message #568908] Wed, 17 October 2012 23:26 Go to previous messageGo to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
Hello Michel.. I am Pasting the code here.. Its the same code as in Oracle Support Document ID : 604763.1
CREATE OR REPLACE PROCEDURE TESTMAIL(fromm VARCHAR2,too VARCHAR2,sub VARCHAR2,body VARCHAR2,port NUMBER)
IS
objConnection UTL_SMTP.CONNECTION;
vrData VARCHAR2(32000);
BEGIN
objConnection := UTL_SMTP.OPEN_CONNECTION('<user smtp server name or ip address>',PORT);
UTL_SMTP.HELO(objConnection, '<user smtp server name or ip address>');
UTL_SMTP.MAIL(objConnection, fromm);
UTL_SMTP.RCPT(objConnection, too);
UTL_SMTP.OPEN_DATA(objConnection);

UTL_SMTP.WRITE_DATA(objConnection, 'From: '||fromm || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'To: '||too || UTL_TCP.CRLF);

UTL_SMTP.WRITE_DATA(objConnection, 'Subject: ' || sub || UTL_tcp.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'MIME-Version: ' || '1.0' || UTL_tcp.CRLF);
UTL_SMTP.WRITE_DATA(objConnection, 'Content-Type: ' || 'text/html;');

UTL_SMTP.WRITE_DATA(objConnection, 'Content-Transfer-Encoding: ' || '"8Bit"' || UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF);
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<HTML>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<BODY>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<FONT COLOR="red" FACE="Courier New">'||body||'</FONT>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</BODY>');
UTL_SMTP.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</HTML>');
UTL_SMTP.CLOSE_DATA(objConnection);
UTL_SMTP.QUIT(objConnection);
EXCEPTION
WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
UTL_SMTP.QUIT(objConnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
WHEN OTHERS THEN
UTL_SMTP.QUIT(objconnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END TESTMAIL;
/ 


DECLARE
Vdate Varchar2(25);
BEGIN
Vdate := to_char(sysdate,'dd-mon-yyyy HH:MI:SS AM');
TESTMAIL('xxx.xxx@xxx.com', 'xxx.xxx@xxx.com', 'TESTMAIL','This is a UTL_SMTP-generated email at '|| Vdate,25);
END;
/
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568952 is a reply to message #568946] Thu, 18 October 2012 01:02 Go to previous messageGo to next message
Michel Cadot
Messages: 68773
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
1/ This is NOT a SQL*Plus session
2/ You didn't use UTL_MAIL, so you lie, so I give up.

Regards
Michel
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568962 is a reply to message #568952] Thu, 18 October 2012 02:29 Go to previous messageGo to next message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
Hi Michel,

I just intended to share the Original Code.
I already shared that using UTL_MAIL is reverting with same Error.

Please find below the UTL_MAIL COde also

CREATE OR REPLACE PROCEDURE TESTMAIL(fromm VARCHAR2,too VARCHAR2,sub VARCHAR2,body VARCHAR2,port NUMBER)
IS
objConnection UTL_MAIL.CONNECTION;
vrData VARCHAR2(32000);
BEGIN
objConnection := UTL_MAIL.OPEN_CONNECTION('mail.maxmsp.com',PORT);
UTL_MAIL.HELO(objConnection, 'mail.maxmsp.com');
UTL_MAIL.MAIL(objConnection, fromm);
UTL_MAIL.RCPT(objConnection, too);
UTL_MAIL.OPEN_DATA(objConnection);

UTL_MAIL.WRITE_DATA(objConnection, 'From: '||fromm || UTL_TCP.CRLF);
UTL_MAIL.WRITE_DATA(objConnection, 'To: '||too || UTL_TCP.CRLF);

UTL_MAIL.WRITE_DATA(objConnection, 'Subject: ' || sub || UTL_tcp.CRLF);
UTL_MAIL.WRITE_DATA(objConnection, 'MIME-Version: ' || '1.0' || UTL_tcp.CRLF);
UTL_MAIL.WRITE_DATA(objConnection, 'Content-Type: ' || 'text/html;');

UTL_MAIL.WRITE_DATA(objConnection, 'Content-Transfer-Encoding: ' || '"8Bit"' || UTL_TCP.CRLF);
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF);
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<HTML>');
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<BODY>');
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF||'<FONT COLOR="red" FACE="Courier New">'||body||'</FONT>');
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</BODY>');
UTL_MAIL.WRITE_DATA(objConnection,UTL_TCP.CRLF||'</HTML>');
UTL_MAIL.CLOSE_DATA(objConnection);
UTL_MAIL.QUIT(objConnection);
EXCEPTION
WHEN UTL_MAIL.TRANSIENT_ERROR OR UTL_MAIL.PERMANENT_ERROR THEN
UTL_MAIL.QUIT(objConnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
WHEN OTHERS THEN
UTL_MAIL.QUIT(objconnection);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END TESTMAIL;
/ 


DECLARE
Vdate Varchar2(25);
BEGIN
Vdate := to_char(sysdate,'dd-mon-yyyy HH:MI:SS AM');
TESTMAIL('rajesh@maxmsp.com', 'yogender@maxmsp.com', 'TESTMAIL','This is a UTL_MAIL-generated email at '|| Vdate,587);
END;
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568964 is a reply to message #568962] Thu, 18 October 2012 02:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68773
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You still lie:
SQL> desc utl_mail
PROCEDURE SEND
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
PROCEDURE SEND_ATTACH_RAW
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
 ATTACHMENT                     RAW                     IN
 ATT_INLINE                     BOOLEAN                 IN     DEFAULT
 ATT_MIME_TYPE                  VARCHAR2                IN     DEFAULT
 ATT_FILENAME                   VARCHAR2                IN     DEFAULT
PROCEDURE SEND_ATTACH_VARCHAR2
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 SENDER                         VARCHAR2                IN
 RECIPIENTS                     VARCHAR2                IN
 CC                             VARCHAR2                IN     DEFAULT
 BCC                            VARCHAR2                IN     DEFAULT
 SUBJECT                        VARCHAR2                IN     DEFAULT
 MESSAGE                        VARCHAR2                IN     DEFAULT
 MIME_TYPE                      VARCHAR2                IN     DEFAULT
 PRIORITY                       BINARY_INTEGER          IN     DEFAULT
 ATTACHMENT                     VARCHAR2                IN
 ATT_INLINE                     BOOLEAN                 IN     DEFAULT
 ATT_MIME_TYPE                  VARCHAR2                IN     DEFAULT
 ATT_FILENAME                   VARCHAR2                IN     DEFAULT

Where do you see a WRITE_DATA procedure there (for instance)?

Use SQL*Plus and copy and paste your session, the WHOLE session INCLUDING procedure creation and execution.

Regards
Michel
Re: ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568995 is a reply to message #568964] Thu, 18 October 2012 07:30 Go to previous message
deepak3arora
Messages: 32
Registered: October 2009
Location: chandigarh
Member
Problem resolved..
Thanks all..

Solution : Some servers Accepts the Email ID in '<deepak3arora@gmail.com>' instead of 'deepak3arora@gmail.com'

Thanks to all AGAIN.. Smile
keep up the good work..
Previous Topic: Using a cursor record in REGEXP_INSTR
Next Topic: problem in table creation
Goto Forum:
  


Current Time: Thu Dec 25 01:03:15 CST 2025