-->

NetworkCredential.Domain Property

2019-08-11 00:31发布

问题:

  MailAddress Sender = new MailAddress("SomeOne@yahoo.com", "SomeOne", Encoding.UTF8);


 SmtpClient Client = new SmtpClient("smtp.mail.yahoo.com",465);
Client.Credentials = new  System.Net.NetworkCredential(Sender.Address,"Password",Domain??? );  

just out of curiosity what is the third overload of NetworkCredential
I mean what we need to pass argument for Domain property . I searched on net but but no one used it(domain property) .I tried "Yahoo.com","@Yahoo.com","Yahoo" bot no every time same authentication error .It can be done without Domain property but where can we use it or what we can pass it .

回答1:

The Domain property is used for NTLM authentication with Active Directory domains.
It is not used for normal login scenarios.