No compatible authentication mechanisms found
I keep getting "System.NotSupportedException: No compatible authentication mechanisms found" when trying to send e-mail out.
I have tried adding one by one following Authenication mechanisms, but no difference client.AuthenticationMechanisms.Add("AuthLogin"); client.AuthenticationMechanisms.Add("AuthPlain"); client.AuthenticationMechanisms.Add("AuthNTLM"); client.AuthenticationMechanisms.Add("AuthAuto");
for the sending I am using same code as in example, just replaced server, user, pwd to my own
using (var client = new SmtpClient ()) { // For demo-purposes, accept all SSL certificates (in case the server supports STARTTLS) client.ServerCertificateValidationCallback = (s,c,h,e) => true;
client.Connect ("smtp.friends.com", 587, false);
// Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove ("XOAUTH2");
// Note: only needed if the SMTP server requires authentication
client.Authenticate ("joey", "password");
client.Send (message);
client.Disconnect (true);
}
And what authentication mechanisms are contained within the AuthenticationMechanisms hash set after you call Connect()?
None?
If none, then the server doesn't support authentication.
Also: "AuthLogin", "AuthPlain", etc. do not match any of the names that need to be used, so of course they don't work :)