SMS Messaging
Server


 Product Overview

 Download (.exe)

 Brochure (.pdf)

 Online Manual

 Release Notes

 Case Studies:
 


Support

 Knowledge Base

 API Samples

 Forum

 Contact Support


Purchase

 Licensing Scheme

 Pricing

 Order now


Related documents

 SMPP Providers

 Cellular
 Communications


 SMS Glossary

 SMS Documents



  Download ActiveXperts SMS Messaging Server 4.1  (5828 KB - .exe file)


Send an SMS message using the SMS Messaging Server API - Visual C# .NET


SMS Messaging Server is an SMS messaging framework that enables companies to send, receive and process SMS- and e-mail messages. The framework is designed support virtually any scenario where low-and high volume SMS messaging is required. Use SMS Messaging Server in the following scenarios:
  • Mobile users query a database; results are sent back via SMS or e-mail;
  • Mobile users receive important information via SMS or e-mail while they are away from the office;
  • Stock prices are sent automatically via SMS and/or e-mail, daily;
  • Remote workers can update their worksheet from a remote location trough SMS;
  • ICT administrators restart/reboot servers and/or daemons from remote by SMS;
  • Setup an SMS voting system, supporting SMS and/or e-mail;
  • Etc.
SMS Messaging Server can be well integrated into VBScript environments.
This document describes how the SMS Messaging Server can be integrated into VBScript projects.


Step 1: Download and install SMS Messaging Server

Download ActiveXperts SMS Messaging Server from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.



Step 2: Create a new Visual C# .NET Project

Launch Microsoft Visual Studio (for instance 'Microsoft Visual Studio 2005') from the Start menu. Choose 'New' from the 'File' menu and click on 'Project'. In the 'New Project' dialog, select a Visual Studio template (for instance: 'Console Application'). Select a name for the application (for instance: 'DemoApp') and a name for the solution (for instance: 'DemoSolution'). Also, select the directory where you want to store the project (for instance: 'C:\MyProjects):

    
    (Click on the picture to enlarge)



Step 3: Refer to the SMS Messaging Server Library and create the objects

Now that a new project has been created, you must add a reference to the SMS Messaging Server API in the project to be able to use the it. To do so, choose 'Add Reference...' from the 'Project' menu. In the 'Add Reference' dialog that pops up, select the 'COM' tab and select the ActiveXperts SMS Messaging Server API Type Library as shown in the following picture:

    
    (Click on the picture to enlarge)

Click 'OK' to close the 'Add Reference' dialog.

On top of your code, type the following line to use the SMS Messageging Server API namespace:
   using AXSMSCFGLib;
In your Main function, declare and create the following objects:
   private IXMessageDB objMessageDB;
   private IXConstants objConstants;
   
   objMessageDB = new XMessageDB();
   objConstants = new XConstants();


Step 4: Send an SMS Message

You can now send an SMS message.

The following code shows how to send a SMS message:
using System;
using System.Collections.Generic;
using System.Text;
using AXSMSCFGLib;

namespace CreateSmsMessage
{
   class Program
   {
      private IXMessageDB objMessageDB;
      private IXConstants objConstants;
      
      public Program()
      {
          objMessageDB = new XMessageDB();
          objConstants = new XConstants();
      }
      
      static void Main(string[] args)
      {
          Program prog = new Program();
          prog.CreateSmsMessage();
      }
      
      public void CreateSmsMessage ()
      {
          objMessageDB.Open();
          if (objMessageDB.LastError > 0)
          {
              Console.WriteLine("Failed to open message database, error: {0}", objMessageDB.LastError);
              return;
          }
      
          object ob = (object) objMessageDB.Create();
          IXMessage objMessage = (IXMessage)ob;
          if (objMessageDB.LastError > 0)
          {
              Console.WriteLine("Create Failed, error: {0}", objMessageDB.LastError);
              return;
          }
      
          Console.WriteLine("Message successfully created, recordID: {0}", objMessage.ID);
      
          objMessage.Direction = objConstants.MESSAGEDIRECTION_OUT;
          objMessage.Type = objConstants.MESSAGETYPE_SMS;
          objMessage.Status = objConstants.MESSAGESTATUS_PENDING;
          objMessage.ChannelID = 0;
          objMessage.ScheduledTime = "";
          objMessage.Recipient = "+31624896641";
          objMessage.Body = "SMS Messaging Server - Test SMS Message";
          objMessageDB.Save( ref ob );
          if (objMessageDB.LastError > 0)
          {
              Console.WriteLine("Update message failed, error: {0}" , objMessageDB.LastError);
              return;
          }
      
          PrintMessage ( objMessage.ID );    
          objMessageDB.Close();
      }
      
      void PrintMessage(int numID)
      {
          IXMessage objMessage = ( IXMessage ) objMessageDB.Load(numID);
          if (objMessageDB.LastError > 0 )
          {
              Console.WriteLine("Failed to load message {0}", numID);
              return;
          }
      
          Console.WriteLine("  ID               : {0}", objMessage.ID);
          Console.WriteLine("  Direction        : {0}", objMessageDB.GetDirectionDescription(objMessage.Direction) );
          Console.WriteLine("  Type             : {0}", objMessageDB.GetTypeDescription(objMessage.Type) );
          Console.WriteLine("  Status           : {0}", objMessageDB.GetStatusDescription(objMessage.Status));
          Console.WriteLine("  StatusDetails    : {0}", objMessageDB.GetStatusDetailsDescription(objMessage.StatusDetails));
          Console.WriteLine("  ChannelID        : {0}", objMessage.ChannelID);
          Console.WriteLine("  MessageReference : {0}", objMessage.MessageReference);
          Console.WriteLine("  ScheduledTime    : {0}", objMessage.GetScheduledTimeString());
          Console.WriteLine("  LastUpdate       : {0}", objMessage.GetLastUpdateString());
          Console.WriteLine("  Sender           : {0}", objMessage.Sender);
          Console.WriteLine("  Recipient        : {0}", objMessage.Recipient);
          Console.WriteLine("  Subject          : {0}", objMessage.Subject);
          Console.WriteLine("  Body             : {0}", objMessage.Body);
          Console.WriteLine("  Trace            : {0}", objMessage.Trace);
      }
   }
}






ActiveXperts SMS Messaging Server is a messaging framework to send and receive email and SMS messages. Use the API to create new messages from various development platforms, including Visual Basic .NET, Visual CSharp .NET, ASP .NET (VB,CS), ASP, Visual Basic, Visual Studio/Visual C++, Delphi, PHP, HTML, VBScript and any other ActiveX/COM compliant platform. SMS Messaging Server is an ActiveXperts Software B.V. Product.

Copyright ©1999-2007 ActiveXperts Software. All rights reserved.