0 votes
by (160 points)
edited

Imap Links to the server :imap.sohu.com 143 login and select inbox complexFilterResult = imapClient.Search( _ ImapSearchParameter.Arrived(DateTime.Date.AddDays(-1), DateTime.Now.AddDays(1)), _ ImapSearchParameter.Subject("test")) Inbox have the mail, but the method can't find some mail

Applies to: Rebex Secure Mail

2 Answers

0 votes
by (58.9k points)
edited

Please try the Search method without specifying the subject. Is the email with the subject "test" present in the ImapMessageCollection then?

        string subject = "test";
        Imap imapClient = new Imap();

        // connect and login here

        imapClient.SelectFolder("INBOX");

        ImapMessageCollection list = imapClient.Search(ImapSearchParameter.Arrived(new DateTime(2011, 6, 14).Date, DateTime.Now.AddDays(1)));

        // check if there is mail with the specified subject
        foreach (ImapMessageInfo info in list)
        {
            Console.WriteLine(info.Subject);

            if (info.Subject == subject)
            {
                Console.WriteLine("Got email with '{0}' subject", subject );
            }
        }
0 votes
by (160 points)
edited

ImapMessageCollection list = imapClient.Search(ImapSearchParameter.Arrived(new DateTime(2011, 6, 14).Date, DateTime.Now.AddDays(1)));

but list.count=0 is abnormal

by (58.9k points)
edited

It looks like the IMAP server does not support searching for mails according to arrived time. Could you please create the log using the LogWriter property as described at http://www.rebex.net/kb/logging/default.aspx and paste it here or mail to support@rebex.net?

...