Skip to content

Instantly share code, notes, and snippets.

@EsendexDev
EsendexDev / GetSentMessageBodies.vb
Created September 4, 2015 14:55
Getting message body texts using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim pageNumber = 1
Dim pageSize = 20
Dim credentials = new EsendexCredentials("Username", "Password")
Dim sentService = New SentService(credentials)
Dim messageBodyService = New MessageBodyService(credentials)
Dim sentMessages = sentService.GetMessages(pageNumber, pageSize)
For Each message As SentMessage In sentMessages.Messages
@EsendexDev
EsendexDev / GetSentMessages.vb
Last active September 4, 2015 15:14
Getting sent messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim pageNumber = 1
Dim pageSize = 20
Dim sentService = new SentService("Username", "Password")
Dim sentMessages = sentService.GetMessages(pageNumber, pageSize)
For Each message As SentMessage In sentMessages.Messages
Console.WriteLine("Message Id: {0}\nMessage Status: {1}\nMessage: {2}\n", message.Id.ToString, message.Status, message.Body.BodyText)
Next
@EsendexDev
EsendexDev / GetInboxMessages.vb
Last active December 9, 2015 09:54
Getting Inbox messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Const pageNumber = 1
Const pageSize = 20
Dim credentials = New EsendexCredentials("Username", "Password")
Dim inboxService = new InboxService(credentials)
Dim messageBodyService = new MessageBodyService(credentials)
Dim receivedMessages = inboxService.GetMessages(pageNumber, pageSize)
@EsendexDev
EsendexDev / CreateAndSendMultiSMS.vb
Last active September 4, 2015 14:53
Creating and sending multiple SMS messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim multipleMessages = New SmsMessageCollection
'Important! Do not forget to set the acount refence on the messages collection
'This should be the same as the account reference for the individual messages
multipleMessages.AccountReference = accountReference
multipleMessages.Items.Add(New SmsMessage("447123456789", "Message Body", accountReference))
multipleMessages.Items.Add(New SmsMessage("447456789123", "Message Body", accountReference))
@EsendexDev
EsendexDev / CreateAndSendSMS.vb
Last active September 4, 2015 14:53
Creating and sending single SMS messages using the Esendex .Net SDK for Visual Basic. Full details here: http://developers.esendex.com/
Dim accountReference = "EX0000123"
Dim messagingService = New MessagingService("Username", "Password")
Dim singleMessage = New SmsMessage("447123456789", "Message Body", accountReference)
messagingService.SendMessage(singleMessage)
UserPassword userPassword = new UserPassword("YourUsername","YourPassword");
BasicServiceFactory serviceFactory = ServiceFactory.createBasicAuthenticatingFactory(userPassword);
MessagingService messagingService = serviceFactory.getMessagingService();
SmsMessageRequest message = new SmsMessageRequest("RecipientNumber", "YourMessage");
MessageResultResponse response;
try{
response = messagingService.sendMessage("YourAccountReference", message);
}catch(Exception e){
e.getStackTrace();
int pageNumber = 1;
int pageSize = 20;
UserPassword userPassword = new UserPassword("YourUsername","YourPassword");
BasicServiceFactory serviceFactory = ServiceFactory.createBasicAuthenticatingFactory(userPassword);
InboxService inboxService = serviceFactory.getInboxService();
InboxMessageCollectionResponse inboxMessages;
try{
inboxMessages = inboxService.getMessages(pageNumber, pageSize);
int pageNumber = 1;
int pageSize = 20;
UserPassword userPassword = new UserPassword("YourUsername","YourPassword");
BasicServiceFactory serviceFactory = ServiceFactory.createBasicAuthenticatingFactory(userPassword);
SentService sentService = serviceFactory.getSentService();
SentMessageCollectionResponse sentMessages;
try{
sentMessages = sentService.getMessages(pageNumber, pageSize);
@EsendexDev
EsendexDev / PhingCredentialsTestExample.sh
Created November 6, 2013 12:13
Checking Esendex credentials using the credenitials test provided with the Esendex PHP SDK
php phing-latest.phar check-access
Buildfile: /home/developer/esendex-php-sdk/build.xml
EsendexSDK > install_dependencies:
EsendexSDK > check-access:
Esendex Username ? [email protected]
Esendex Password ? secret
@EsendexDev
EsendexDev / RunPhingTests.sh
Created November 6, 2013 12:10
Running tests for the Esendex PHP SDK using the phing build utility for PHP
php phing-latest.phar