Skip to content

Instantly share code, notes, and snippets.

@Codesleuth
Forked from EsendexDev/CreateAndSendSMS.cs
Last active December 22, 2015 15:39
Show Gist options
  • Save Codesleuth/6493876 to your computer and use it in GitHub Desktop.
Save Codesleuth/6493876 to your computer and use it in GitHub Desktop.
Creating and Sending SMS messages using the Esendex .Net SDK - Full details here: http://developers.esendex.com/
using com.esendex.sdk;
using com.esendex.sdk.messaging;
...
var credentials = new EsendexCredentials(USERNAME, PASSWORD);
var messagingService = new MessagingService(true, credentials);
try
{
var message = new SmsMessage("447123456789", "This is a test message...", "<myAccountReference>");
var result = messagingService.SendMessage(message);
Console.WriteLine("Sent Message Batch Id: {0}", result.BatchId);
foreach (var messageId in result.MessageIds)
{
Console.WriteLine("Message Uri: {0}", messageId.Uri);
}
}
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