public static void Run() { Pop3Client client = new Pop3Client(); client.Host = "pop.gmail.com"; client.Port = 995; client.SecurityOptions = SecurityOptions.SSLImplicit; client.Username = "******"; client.Password = "******"; try { // ExStart:ListMessagesAsynchronouslyWithMailQuery MailQueryBuilder builder = new MailQueryBuilder(); builder.Subject.Contains("Subject"); MailQuery query = builder.GetQuery(); IAsyncResult asyncResult = client.BeginListMessages(query); Pop3MessageInfoCollection messages = client.EndListMessages(asyncResult); // ExEnd:ListMessagesAsynchronouslyWithMailQuery } catch (Exception ex) { Console.WriteLine(ex.Message); } }