locked
SmtpClient and NTLM Authentication with Exchange 2007 RRS feed

  • Question

  •  

    Hello,

     

    I need to use NTLM authentication with our Exchange 2007 SMTP Servers, but i'm having some problems authenticating !

    In detail, a user, at his workstation, and logged on the domain (same as Exchange) to be able to NTLM authenticate himself to the Exchange SMTP.

     

    Using the System.Net.Mail.SmtpClient class, i tryed setting the Credentials property in the following ways:

     

    1) ...Credentials = new NetworkCredential(username, password, domain);

    2) ...Credentials = CredentialCache.DefaultNetworkCredentials;

    3) ...Credentials = System.Net.CredentialCache.DefaultCredentials.GetCredential(new Uri("smtp://server.fqdn"), "NTLM");

     

    All fail because the SmtpClient always sends: AUTH gssapi <base64>

    SMTP returns: 535 5.7.3 Authentication Unsucessfull

     

    And now.. using the deprecated System.Web.Mail namespace, specifying NTLM authentication, all goes fine

     

    What is going wrong here ?!? How to force AUTH ntlm ? Help please.

     

    Thanks in advance,

    Fernando Nunes

    Friday, July 13, 2007 7:54 PM

Answers