Beispiel #1
0
        static void ListMessages()
        {
            GmailServiceBuilder gmailServiceBuilder = new GmailServiceBuilder();
            var listOfMessages = gmailServiceBuilder.ListMessages("me", "is:read after:2018/01/01 before:2018/02/07"); //interval query

            foreach (Message item in listOfMessages)
            {
                //var message = gmailServiceBuilder.GetMessage("me", item.Id);
                var messageSecond = gmailServiceBuilder.GetMinimalMessage("me", item.Id);
                //var listOfLabels = gmailServiceBuilder.GetLabelsForMessage("*****@*****.**");
                //bool isImportant = gmailServiceBuilder.MessageHasImportantLabel(message);
                var x = 2;
            }
        }
Beispiel #2
0
        static void ListMessagesBetweenIntervals()
        {
            //https://support.google.com/mail/answer/7190?hl=en
            GmailServiceBuilder gmailServiceBuilder = new GmailServiceBuilder();
            var listOfMessages = gmailServiceBuilder.ListMessages("me", "is:unread after:2017/09/16 before:2017/09/25");

            foreach (Message item in listOfMessages)
            {
                var  message      = gmailServiceBuilder.GetMessage("me", item.Id);
                var  listOfLabels = gmailServiceBuilder.GetLabelsForMessage(message);
                bool isImportant  = gmailServiceBuilder.MessageHasImportantLabel(message);
                var  x            = 2;
            }
        }
Beispiel #3
0
        static void ListLabels()
        {
            GmailServiceBuilder gmailServiceBuilder = new GmailServiceBuilder();
            var labels = gmailServiceBuilder.GetLabelList();

            Console.WriteLine("Labels:");
            if (labels != null && labels.Count > 0)
            {
                foreach (var labelItem in labels)
                {
                    Console.WriteLine("{0}", labelItem.Name);
                }
            }
            else
            {
                Console.WriteLine("No labels found.");
            }
            Console.Read();
        }