This project is read-only.

Search results from Gmail

Topics: Help requests
Jan 15, 2014 at 10:41 PM
Hi, I use Gmail like this: in:all

and I get more 1000 messages.

If I use this code using Imapx, I get 233 messages.
  var user = ServicioEnvioCorreo.Service1.USUARIO;
                var pass = ServicioEnvioCorreo.Service1.GOOGLE_ACCOUNT_APPLICATION_PASS; // PASSWORD_IMAP;
                using (var Client = new ImapClient("", 993, user, pass, AuthMethod.Login, true))
                    uint[] uids = Client.Search(

                    MailMessage[] messages = Client.GetMessages(uids);
Any suggestions?
Jan 16, 2014 at 9:08 AM
Hi kiquenet,

the above code has nothing to do with ImapX. It's for the S22.Imap client. However, in ImapX try the following:
var client = new ImapClient("", true);
     if(client.Login(user, pass))
           var msgs = client.Folders.All.Search("FROM \"\"");
Best regards,

Jan 16, 2014 at 1:43 PM
Edited Jan 16, 2014 at 1:44 PM
Sorry Pavel.

Thx, it's great ImapX

Mabye many messages has a label. The target is get all messages from mailer-daemon, is right now using your code,

and another step get all messages from mailer-daemon and has a label.

Jan 17, 2014 at 7:27 PM
Now, it fails for me when I try use OR operator like this:
            var messages = client.Folders.All.Search("FROM \"\""
                            + " OR (FROM \"\")"
                            + " OR (FROM \"\")"
Jan 17, 2014 at 8:35 PM
Hi kiquenet,

try removing the surrounding braces.

For your question about labels, you need to use the X-GM-RAW extension, then you can use the extended search syntax for GMail.
var messages = client.Folders.All.Search("X-GM-RAW \"( OR ( (label:mylabel)\"");