private static void GetInboxMessagesExample() { int pageNumber = 1; int pageSize = 15; InboxService inboxService = new InboxService(Credentials); try { InboxMessageCollection collection = inboxService.GetMessages(pageNumber, pageSize); foreach (InboxMessage item in collection.Messages) { Console.WriteLine("Message Id:{0}\nMessage:{1}\n\n", item.Id, item.Summary); } } catch (WebException ex) { Console.Write(ex.Message); } }
private static void GetInboxMessagesExample(EsendexCredentials credentials, MessageBodyService messageBodyService) { var inboxService = new InboxService(credentials); try { var collection = inboxService.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); } }