I have read every MailKit problem, but mine still will NOT work. I have removed my actual logins passwords, but they are correct for the account.
using (var client = new ImapClient(new ProtocolLogger(@"c:\temp\imaplog.txt")))
{
try
{
client.Connect("outlook.office365.com", 993, true);
client.AuthenticationMechanisms.Remove("XOAUTH2");
client.AuthenticationMechanisms.Clear();
client.SslProtocols = SslProtocols.Tls;
client.Authenticate(<username>,<password>);
//var inbox = client.mai;
//inbox.Open(FolderAccess.ReadWrite);
//var uids = await inbox.SearchAsync(MailKit.Search.SearchQuery.NotSeen);
}
catch (Exception exc)
{
}
}
IMAP logfile
Connected to imaps://outlook.office365.com:993/
S: * OK The Microsoft Exchange IMAP4 service is ready. [UwBOADYAUABSADAAMQBDAEEAMAAwADAAMwAuAHAAcgBvAGQALgBlAHgAYwBoAGEAbgBnAGUAbABhAGIAcwAuAGMAbwBtAA==]
C: A00000000 CAPABILITY
S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
S: A00000000 OK CAPABILITY completed.
C: A00000001 LOGIN username password
S: A00000001 NO LOGIN failed.
@domainportion of the account email address? What if you try not including it or including it (i.e. do the opposite of what you are doing)? What happens if you removeclient.AuthenticationMechanisms.Clear();to allow MailKit to use PLAIN authentication? Make sure to try with and without the@domainwhen testing with PLAIN as well. - jstedfast[email protected]or[email protected]. - jstedfast