.NET MailKit 在一个帐户中从两个邮箱读取邮件

问题描述 投票:0回答:0

我正在使用 Mailkit 阅读来自 Ms Exchange 帐户的电子邮件。 一切正常,但如果 corm\john.doe 有两个邮箱“[email protected]”和“[email protected]”怎么办?

Mailkit流程中没有邮箱地址参数

using (var client = new ImapClient ()) {
        client.Connect ("imap.corp.com", 993, SecureSocketOptions.SslOnConnect);

        client.Authenticate ("corp\\john doe", "password");

        client.Inbox.Open (FolderAccess.ReadOnly);

        var uids = client.Inbox.Search (SearchQuery.All);

        foreach (var uid in uids) {
            var message = client.Inbox.GetMessage (uid);

            // write the message to a file
            message.WriteTo (string.Format ("{0}.eml", uid));
        }

        client.Disconnect (true);
    }

如何读取两个邮箱的消息?

c# mailkit
© www.soinside.com 2019 - 2024. All rights reserved.