How to read emails from an specific Label in gmail inbox

Topics: Archive, Help requests
Sep 10, 2014 at 1:33 PM
Hi all,

i want to know how can in read emails from an specific label using Imapx Library.i can read the mails from the folders but not able to do that with the lables.


Thanks
Coordinator
Sep 10, 2014 at 4:22 PM
Hi NITIN1670,

to search message by a specific label, you can use the X-GM-RAW query, and specify a query as described here.

A quick sample:
var messages = client.Folders.All.Search("X-GM-RAW \"(label:mylabel)\"");
If you have further questions, feel free to ask.

Greets,

Pavel
May 8, 2015 at 7:06 PM
Hi Pavel, i'm using your api and so far it's great. i had a question regarding search query/syntax. Does that link you provided apply to imap in general? or just gmail

https://support.google.com/mail/answer/7190?hl=en

thanks again

Allen
Coordinator
May 10, 2015 at 9:41 AM
Hi Allen,

the advanced seacrh syntax is GMail specific only. For other IMAP servers please refer to the IMAP specification: https://tools.ietf.org/html/rfc3501#section-6.4.4


Best regards,

Pavel