Advertisement
mnakos

.net library για αποστολή SMS (VB code)

Jan 31st, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.88 KB | None | 0 0
  1. Imports Terracom.Liveall.ConnectorLib
  2.  
  3. Module Module1
  4.     Sub Main()
  5.         Dim sms_connector As New Connector()
  6.         Dim res As Models.OP_RESULT
  7.         Dim submit_info(1) As Models.HttpApiJSMSParts
  8.         Dim si As New Models.HttpApiJSMSParts
  9.  
  10.         si.destination = "306912345678"
  11.         si.message = "Test message - English. Δοκιμαστικό μήνυμα (Ελληνικά)"
  12.         submit_info(0) = si
  13.  
  14.         sms_connector.Init("MY_VERY_SECRET_TOKEN", "mySenderID")
  15.         res = sms_connector.SendSms(submit_info, 0)
  16.         If res.ErrorCode <> SMS_SERVICE_ERROR_CODES.NO_ERROR Then
  17.             Console.WriteLine("Problem sending SMS. Error message: {0}", res.ErrorMessage)
  18.         Else
  19.             Console.WriteLine("SMS sent sucessfully! SMSId for 1st sent message: {0}", res.SubmitInfo.FirstOrDefault().smsid)
  20.         End If
  21.  
  22.     End Sub
  23.  
  24. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement