mailKit Failed to receive mail from outlook mailbox using c# during login step

service service 0 Reputation points
2023-07-07T09:35:57.4366667+00:00
    imapClient.Connect(account.Server, account.Port, SecureSocketOptions.SslOnConnect, tokenSource.Token);
                //imapClient.Authenticate(account.Account, account.Password, tokenSource.Token);
                imapClient.AuthenticationMechanisms.Add("XOAUTH2");
                imapClient.Authenticate(System.Text.Encoding.UTF8,account.Account, account.Password, tokenSource.Token)

c# code so login prompt login failure
How do I log in successfully
Outlook
Outlook
A family of Microsoft email and calendar products.
4,494 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.