【发布时间】:2017-06-02 20:28:31
【问题描述】:
我正在使用 s22.Imap 引用从服务器获取新邮件。在读取交换服务器时,一切都很完美。但是我们被转移到了office365。现在我无法从我的项目中读取新邮件。这是小代码。
using (ImapClient client = new ImapClient("outlook.office365.com", 993, user, pass, AuthMethod.Login, true)) {
// Returns a collection of identifiers of all mails matching the specified search criteria.
IEnumerable<uint> uids = client.Search(SearchCondition.New());
// Download mail messages from the default mailbox.
IEnumerable<MailMessage> messages = client.GetMessages(uids);
foreach (MailMessage item in messages) { blablabla }
这部分返回这个错误:The stream could not be read.
最后,我在 Windows 服务应用程序中使用了这些代码。所以我没有明确调试。
有人帮助我吗?
【问题讨论】: