“153cc168f2424284” is the Gmail thread-ID in hex. Use Convert.ToInt64 to parse it:
decimal threadID = Convert.ToInt64("153cc168f2424284", 16);
Then you can use Imap.Search method along with Expression.GmailThreadId to find all messages in this thread:
List<long> uids = imap.Search(Expression.GmailThreadId(threadID));
Entire code:
decimal threadID = Convert.ToInt64("153cc168f2424284", 16);
using (Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("user@gmail.com", "password");
imap.SelectInbox();
List<long> uids = imap.Search(Expression.GmailThreadId(threadID));
// now download each message and display the subject
foreach (long uid in uids)
{
IMail message = new MailBuilder()
.CreateFromEml(imap.GetMessageByUID(uid));
Console.WriteLine(message.Subject);
}
imap.Close();
}