Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / March 2008

Tip: Looking for answers? Try searching our database.

SmtpClient.UseDefaultCredentials does not work in Authenticated SM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vik - 11 Mar 2008 19:58 GMT
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
Henning Krause [MVP - Exchange] - 11 Mar 2008 23:10 GMT
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

>I use SmtpClient to send email in my program, and I set the
> UserDefaultCredentials to true to use the logged on user's credentials.
[quoted text clipped - 12 lines]
>
> Vik
vik - 12 Mar 2008 14:56 GMT
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

> Hello,
>
[quoted text clipped - 35 lines]
> >
> > Vik

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.