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)
ORA-29278: SMTP transient error: 401 4.1.7 Bad sender address syntax [message #568887] |
Wed, 17 October 2012 07:17  |
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 #568900 is a reply to message #568899] |
Wed, 17 October 2012 07:37   |
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 #568946 is a reply to message #568908] |
Wed, 17 October 2012 23:26   |
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 #568962 is a reply to message #568952] |
Thu, 18 October 2012 02:29   |
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;
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Dec 25 01:03:15 CST 2025
|