C# AE.Net.Mail无法连接到outlook.office365.com IMAP
我发现我无法使用连接到outlook.office365.com的IMAP服务器。代码非常简单:C# AE.Net.Mail无法连接到outlook.office365.com IMAP,c#,email,imap,C#,Email,Imap,我发现我无法使用连接到outlook.office365.com的IMAP服务器。代码非常简单: this._imapClient = new ImapClient(imapServer, username, password, AE.Net.Mail.AuthMethods.Login, port, enableSSL) 我发现我可以毫无问题地连接到GMail,但office365 outlook将无法连接,我不断超时。我已经通过将IMAP设置放入Outlook和Thunderbird中验证
this._imapClient = new ImapClient(imapServer, username, password, AE.Net.Mail.AuthMethods.Login, port, enableSSL)
我发现我可以毫无问题地连接到GMail,但office365 outlook将无法连接,我不断超时。我已经通过将IMAP设置放入Outlook和Thunderbird中验证了它们
是否有其他人在将AE.Net.Mail连接到Office365的IMAP服务器时遇到问题?发现我可以通过增加超时来连接:
_imapClient.ServerTimeout = 120000;
_imapClient.IdleTimeout = 120000;
_imapClient.Connect(_imapServer, _port, _enableSSL, false);
_imapClient.Login(_username, _password);
_imapClient.SelectMailbox("Inbox");
在我上次检查的一年多时间里,AE.Net.Mail有很多问题,没有任何进展。我建议你改用 我刚刚确认MailKit与Office365.com配合使用,代码片段如下:
using (var client = new ImapClient ()) {
client.Connect ("outlook.office365.com", 993, true);
client.Authenticate ("username", "password");
// get the unread messages
var uids = client.Inbox.Search (SearchQuery.NotSeen);
foreach (var uid in uids) {
var message = client.Inbox.GetMessage (uid);
}
client.Disconnect (true);
}
希望这能有所帮助。查看之前的stackoverflow帖子,它并没有真正回答他的问题。发布了一个答案。。。我们可以通过增加时间来解决这个问题。在使用ae.net.mail获取新的未读gmail邮件时遇到问题。。。因此,我将尝试MailKit Alsoi如果您有任何问题,您可以添加问题或在我的github页面上找到我的电子邮件地址。哪里可能是一个很好的示例,演示如何仅将未读邮件作为列表返回?我刚刚更新了答案,以显示如何获取未读邮件。非常感谢!正在尝试用MailKit替换我系统中的AE.Net.Mail。如果我在其他事情上遇到困难,我会告诉你的。