Пример #1
0
        private static void GetSentMessagesExample(EsendexCredentials credentials, MessageBodyService messageBodyService)
        {
            var sentService = new SentService(credentials);

            try
            {
                var collection = sentService.GetMessages(_accountReference, PageIndex, PageSize);

                foreach (var item in collection.Messages)
                {
                    if (messageBodyService != null)
                    {
                        messageBodyService.LoadBodyText(item.Body);
                        Console.WriteLine("\tMessage Id:{0}\tSummary:{1}\n\tBody:{2}\n",
                                          item.Id,
                                          item.Summary,
                                          item.Body.BodyText);
                    }
                    else
                    {
                        Console.WriteLine("\tMessage Id:{0}\tSummary:{1}",
                                          item.Id,
                                          item.Summary);
                    }
                }
            }
            catch (WebException ex)
            {
                Console.Write(ex.Message);
            }
        }
Пример #2
0
        private static void GetSentMessagesExample()
        {
            int pageNumber = 1;
            int pageSize = 15;

            SentService sentService = new SentService(Credentials);

            try
            {
                SentMessageCollection collection = sentService.GetMessages(pageNumber, pageSize);

                foreach (SentMessage item in collection.Messages)
                {
                    Console.WriteLine("Message Id:{0}\nMessage:{1}\n\n", item.Id, item.Summary);
                }

            }
            catch (WebException ex)
            {
                Console.Write(ex.Message);
            }
        }