Windows Vista Forums

SmtpClient.UseDefaultCredentials does not work in Authenticated SM

  1. #1


    vik Guest

    SmtpClient.UseDefaultCredentials does not work in Authenticated SM

    I use SmtpClient to send email in my program, and I set the
    UserDefaultCredentials to true to use the logged on user's credentials.
    However it doesn't work on authenticated SMTP server. It will throws
    exception saying 'System.Net.Mail.SmtpException: The SMTP server requires a
    secure connection or the client was not authenticated. The server response
    was: 5.7.3 Client was not authenticated'

    However if I set UserDefaultCredentials to false and hard-coded my login and
    password for SmtpClient.Credentials, it works. It seems as if the
    UseDefaultCredentials does not set loggon user's credentials correctly.

    Any help would really appreciated.

    Vik

      My System SpecsSystem Spec

  2. #2


    Henning Krause [MVP - Exchange] Guest

    Re: SmtpClient.UseDefaultCredentials does not work in Authenticated SM

    Hello,

    what SMTP server are you using?

    If you use the credential of the currently logged on user, the mail server
    must support NTLM authentication. If it just supports the LOGIN method, it
    won't work.
    To check if the server supports this, open a command prompt and type
    telnet servername 25

    this will open a connection to the smtp server. Then type
    ehlo

    This will send an extended helo request to the server. The server will now
    list all supported commands. If you find a line stating
    250-AUTH NTLM

    the server has NTLM authentication enabled. If not - you can't use the
    default credentials.

    Kind regards,
    Henning Krause

    "vik" <vik@xxxxxx> wrote in message
    news:F3A795E9-F783-4060-8452-0F09CB769D89@xxxxxx

    >I use SmtpClient to send email in my program, and I set the
    > UserDefaultCredentials to true to use the logged on user's credentials.
    > However it doesn't work on authenticated SMTP server. It will throws
    > exception saying 'System.Net.Mail.SmtpException: The SMTP server requires
    > a
    > secure connection or the client was not authenticated. The server response
    > was: 5.7.3 Client was not authenticated'
    >
    > However if I set UserDefaultCredentials to false and hard-coded my login
    > and
    > password for SmtpClient.Credentials, it works. It seems as if the
    > UseDefaultCredentials does not set loggon user's credentials correctly.
    >
    > Any help would really appreciated.
    >
    > Vik

      My System SpecsSystem Spec

  3. #3


    vik Guest

    Re: SmtpClient.UseDefaultCredentials does not work in Authenticate

    Hi Henning,

    Thank you very much for your reply to my question. You are right; it was the
    SMTP server not supporting NTLM issue, and after we have SMTP server's
    settings changed to support NTLM, the email client was able to send email
    sucessfully.

    Again, I really appreciate your help.

    Best Regards,
    Vik

    "Henning Krause [MVP - Exchange]" wrote:

    > Hello,
    >
    > what SMTP server are you using?
    >
    > If you use the credential of the currently logged on user, the mail server
    > must support NTLM authentication. If it just supports the LOGIN method, it
    > won't work.
    > To check if the server supports this, open a command prompt and type
    > telnet servername 25
    >
    > this will open a connection to the smtp server. Then type
    > ehlo
    >
    > This will send an extended helo request to the server. The server will now
    > list all supported commands. If you find a line stating
    > 250-AUTH NTLM
    >
    > the server has NTLM authentication enabled. If not - you can't use the
    > default credentials.
    >
    > Kind regards,
    > Henning Krause
    >
    > "vik" <vik@xxxxxx> wrote in message
    > news:F3A795E9-F783-4060-8452-0F09CB769D89@xxxxxx

    > >I use SmtpClient to send email in my program, and I set the
    > > UserDefaultCredentials to true to use the logged on user's credentials.
    > > However it doesn't work on authenticated SMTP server. It will throws
    > > exception saying 'System.Net.Mail.SmtpException: The SMTP server requires
    > > a
    > > secure connection or the client was not authenticated. The server response
    > > was: 5.7.3 Client was not authenticated'
    > >
    > > However if I set UserDefaultCredentials to false and hard-coded my login
    > > and
    > > password for SmtpClient.Credentials, it works. It seems as if the
    > > UseDefaultCredentials does not set loggon user's credentials correctly.
    > >
    > > Any help would really appreciated.
    > >
    > > Vik
    >
    >

      My System SpecsSystem Spec

SmtpClient.UseDefaultCredentials does not work in Authenticated SM

Similar Threads
Thread Forum
Require that all senders are authenticated
I'm just starting to dabble with PowerShell and I love it! It's very powerful, and extremely useful for SysAdmins. I've been messing around in the...
PowerShell
How to get 'Authenticated user' group back
Hi, I accidentally unchecked all the allow permissions for 'Authenticated user' group and clicked 'OK', since then the 'Authenticated user' group...
Network & Sharing
Spool ID - SmtpClient Class
Hello people, This is my first post and I am in need of help. I have written a simple email queue app using the smtplcient .net class. But i...
.NET General
smtpclient.send failure
I am working with a script that generates a mail storm for an Exchange 2007 demo. Everything seems to be in place until it gets to the .send Here...
PowerShell
SmtpClient - Sending emails with out settings credentials.
There is probably a issue with SmtpClient and the connection pooling. Scenario: 1. Send a MailMessage using SmtpClient.Send method, with out...
.NET General
SMTPClient Authentication problems
I am having problems Authenticating to my SMTP Server. The code I am using is as follows public void SendMail(string fromAddress, string...
.NET General
Re: Authenticated Users
On Sat, 09 Feb 2008 16:40:37 +0800, Man-wai Chang ToDie wrote: It is a computed group. When you are authenticated by the system membership in...
Vista security