小编Bha*_*kar的帖子

需要帮助IMAP INBOX根据收到的日期进行搜索

我正在使用开源IMAP C#库IMapX(http://hellowebapps.com/products/imapx/).当我试图从INBOX收到电子邮件时,需要花费很多时间.有没有办法根据收到的日期过滤收件箱?

以下代码是一个示例.搜索基于UNSEEN.我想根据收到的日期过滤大于给定日期.

ImapX.ImapClient client = new ImapX.ImapClient("imap.gmail.com", 993, true);
    bool result = false;

    result = client.Connection();
    if (result)
        MessageBox.Show("Connection Established");

    result = client.LogIn(textBox1.Text, textBox2.Text);
    if (result)
    {
        MessageBox.Show("Logged in");
        ImapX.FolderCollection folders = client.Folders;
        ImapX.MessageCollection messages = client.Folders["INBOX"].Search("UNSEEN", true); //true - means all message parts will be received from server

        int unread = messages.Count;
        string unseen = unread.ToString();
        button1.Text = unseen;
    }
Run Code Online (Sandbox Code Playgroud)

imap

3
推荐指数
1
解决办法
7806
查看次数

标签 统计

imap ×1