Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - SmtpClient.UseDefaultCredentials does not work in Authenticated SM

Reply
 
Old 03-11-2008   #1 (permalink)
vik


 
 

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
Old 03-11-2008   #2 (permalink)
Henning Krause [MVP - Exchange]


 
 

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
Quote:

>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
Old 03-12-2008   #3 (permalink)
vik


 
 

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:
Quote:

> 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
Quote:

> >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
Reply

Thread Tools


Similar Threads
Thread Forum
Spool ID - SmtpClient Class .NET General
smtpclient.send failure PowerShell
SmtpClient - Sending emails with out settings credentials. .NET General
SMTPClient Authentication problems .NET General
Re: Authenticated Users Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46