Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sending Mails using UTL_SMTP with Microsoft Exchange Server 2007

Vamsi RampalliJan 6 2011 — edited Jan 6 2011
I am trying to send emails using out mail host Microsoft Exchange 2007. When I send the mail to other domains with out authentication them I am getting an error

ERROR at line 1:
ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay
ORA-06512: at "SYS.UTL_SMTP", line 20
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 240
ORA-06512: at line 9

If I use authentication as below
Declare
l_mailhost VARCHAR2 (255) := '<mail host>';
l_mail_conn UTL_SMTP.connection;
BEGIN
l_mail_conn := UTL_SMTP.open_connection (l_mailhost, '<Port Number>');
UTL_SMTP.helo (l_mail_conn, l_mailhost);
utl_smtp.command( l_mail_conn, 'AUTH LOGIN');
utl_smtp.command( l_mail_conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( '<User Name>' ))) );
utl_smtp.command( l_mail_conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( '<Password>' ))) );
UTL_SMTP.mail (l_mail_conn, '<From User>');
UTL_SMTP.rcpt (l_mail_conn, '<To User>');
UTL_SMTP.open_data (l_mail_conn);
utl_smtp.write_data(l_mail_conn, 'Subject: Your Subject Line Here');
UTL_SMTP.write_data (l_mail_conn, 'This is a test mail.........');
UTL_SMTP.close_data (l_mail_conn);
UTL_SMTP.quit (l_mail_conn);
END;

I am getting the following error
Error at line 1
ORA-29279: SMTP permanent error: 504 5.7.4 Unrecognized authentication type
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 159
ORA-06512: at line 9
Script Terminated on line 1.


the reason could be, my server does not support authentication type LOGIN. It supports GSSAPI NTLM.
Can anyone help me in using GSSAPI NTLM to authenticate the mail server.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 3 2011
Added on Jan 6 2011
2 comments
1,480 views