Skip to content

Instantly share code, notes, and snippets.

@Codesleuth
Last active December 22, 2015 15:39
Show Gist options
  • Save Codesleuth/6494036 to your computer and use it in GitHub Desktop.
Save Codesleuth/6494036 to your computer and use it in GitHub Desktop.
Getting sent message body texts using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk.messaging;
using com.esendex.sdk.sent;
...
const int pageNumber = 1;
const int pageSize = 20;
var credentials = new EsendexCredentials(USERNAME, PASSWORD);
var sentService = new SentService(credentials);
var messageBodyService = new MessageBodyService(credentials);
try
{
var sentMessages = sentService.GetMessages(pageNumber, pageSize);
foreach (var message in sentMessages.Messages)
{
messageBodyService.LoadBodyText(message.Body);
Console.WriteLine("Message Id:{0}\nMessage:{1}\n\n", message.Id, message.Body.BodyText);
}
}
catch (WebException ex)
{
Console.Write(ex.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment