ActiveXperts
SMS & MMS Toolkit


 Product Overview

 Supported Protocols:
 
 How to use

 Online Samples

 Download (.exe)

 Brochure (.pdf)

 Manual (.htm)

 Release Notes


Support

 Knowledge Base

 Forum

 Contact Support


Purchase

 Licensing

 Pricing

 Order now


Providers

 SMPP Providers

 MMS Providers

 TAP/UCP Providers

 SNPP Providers


Related documents

 Case studies

 SMS Documents

 GSM Network Codes

 TAPI Documents

 About Mobile
 Communications


 AT Commands

 RFC's


  Download ActiveXperts SMS and MMS Toolkit 5.0  (6754 KB - .exe file)
  Download Manual  (623 KB - .htm file)


Using The SMS and MMS Toolkit with ASP .NET (C#)


The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality.
An SMS messages can be sent using a GSM/GPRS modem, an SMPP provider, an HTTP compliant SMS provider or using a standard dialup or fixed-line SMS modem.
An MMS messages can be sent via a GSM/GPRS modem (MM1), an SMTP server (MM4) or an XML/SOAP compliant provider (MM7).

SMS features:
  • Send and receive numeric- and alphanumeric text SMS messages
  • Verify delivery of outgoing SMS messages
  • Support for multimedia SMS messages, including ringtones, pictures and logo's
  • Support for WAP Push, WAP Bookmarks, vCards, voicemail/e-mail/fax/MMS indications
  • Support for Unicode, to support foreign languages like Chinese, Turkisch, etc.
  • Support for multi-part messages, to allow messages longer than 160 characters
  • Support for GSM modems, GSM phones, SMS/HTTP providers, SMPP (Short Message Peer to Peer) providers, TAP/XIO and UCP dial-in SMSC providers
  • Support Multi-threading environments. The component is thread-safe, which means it can be used in a multi-threaded environment
  • Samples included for various development platforms: MS Visual Basic, MS Visual Basic .NET, MS Visual C++, MS Visual Studio C# .NET, ASP, ASP .NET, Borland Delphi, Borland C++ Builder, ColdFusion and more
MMS features:
  • Support for many multimedia formats incl.: JPG, GIF, PNG, BMP, WBMP, TIF, WAV, MP3, MIDI, AC3, GP3, AVI, MPG, MP4, VCARD, VCALENDAR, JAR and more
  • Support for MM1 (MMS over WAP), MM4 (MMS over SMTP) and MM7 (MMS over HTML/SOAP)
Pager features:
  • Send alpha-numeric Pager messages through SNPP

This document describes how the SMS and MMS Toolkit can be integrated into into ASP .NET (C#) projects.


Prerequisites

You must install and configre Internet Information Services (IIS) before using the SMS and MMS Toolkit with ASP .NET
If you don't have IIS installed, use the following steps:
  • From the Control Panel, click 'Add/Remove Programs'. Select the 'Add/Remove Windows Components' icon from the left pane, then select 'Application Server' and click on 'Details'. You can now select both 'ASP .NET' and 'Internet Information Services (IIS)'. Click 'OK' to continue installation;
  • Make sure that ASP .NET is allowed on the web server:


    (Click on the picture to enlarge)



Step 1: Download and install the SMS and MMS Toolkit

Download the the SMS and MMS Toolkit from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.



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

Launch Microsoft Visual Studio (for instance 'Microsoft Visual Studio 2005') from the Start menu. Choose 'New' from the 'File' menu and click on 'Web Site'. In the 'Web Site' dialog, select ASP .NET Web Site. 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 and MMS Toolkit Library

Now that a new project has been created, you must add a reference to the SMS and MMS Toolkit in the project to be able to use the the SMS and MMS Toolkit objects. 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 and MMS Toolkit Type Library' as shown in the following picture:

    
    (Click on the picture to enlarge)

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



Step 4: Declare and create the SMS and MMS Toolkit objects

On top of your code, type the following line to use the SMS and MMS Toolkit namespace:
   using AXmsCtrl;
In your Main function, declare and create the following objects:
   SmsProtocolHttp objHttpProtocol = new SmsProtocolHttp();
Insert the following line to declare and create the SmsMessage object:
   SmsMessage objSmsMessage = new SmsMessage()
Insert the following line to declare and create the SmsConstants object:
   SmsConstants objSmsConstants = new SmsConstants()


Step 5: Send SMS messages

You can now send SMS messages.

The following code shows how to send a SMS message through an HTTP POST based SMS provider:

webform.aspx
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using AXmsCtrl;

namespace SendSms
{
  /// <summary>
  /// Summary description for WebForm1.
  /// </summary>
  public class WebForm1 : System.Web.UI.Page
  {
    protected System.Web.UI.HtmlControls.HtmlForm Form1;
    protected System.Web.UI.HtmlControls.HtmlInputText TextRecipient;
    protected System.Web.UI.HtmlControls.HtmlTextArea TextMessage;
    protected System.Web.UI.HtmlControls.HtmlInputCheckBox CheckboxUnicode;
    protected System.Web.UI.HtmlControls.HtmlInputText TextResult;
    protected System.Web.UI.HtmlControls.HtmlInputText TextSender;
    protected System.Web.UI.HtmlControls.HtmlInputButton Submit;
    protected System.Web.UI.HtmlControls.HtmlInputText TextResponse;
	
    private SmsProtocolHttp  objHttpProtocol;
    private SmsConstants     objSmsConstants;
    private SmsMessage       objSmsMessage;

    private void Page_Load(object sender, System.EventArgs e)
    {
      objHttpProtocol = new SmsProtocolHttp();
      objSmsMessage   = new SmsMessage();
      objSmsConstants = new SmsConstants();
    }

    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
      //
      // CODEGEN: This call is required by the ASP.NET Web Form Designer.
      //
      InitializeComponent();
      base.OnInit(e);
    }
		
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {    
      this.Submit.ServerClick += new System.EventHandler(this.Submit_ServerClick);
      this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion

    private void Submit_ServerClick(object sender, System.EventArgs e)
    {
      object obj;

      // Clear all properties
      objHttpProtocol.Clear();

      // Provider Settings
      objHttpProtocol.ProviderHost = "post.activexperts-labs.com";
      objHttpProtocol.ProviderPort = 8080;

      objHttpProtocol.ProviderErrorResponse   = "ERR"; // Response should NOT contain 'ERR'
      objHttpProtocol.ProviderSuccessResponse = "id" ; // Response should contain 'id'

      // URL Templates
      objHttpProtocol.URLText    = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%";
      objHttpProtocol.URLBinary  = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%&data=1";
      objHttpProtocol.URLUnicode = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%&unicode=1";

      // SMS Message Properties
      objSmsMessage.Sender = TextSender.Value;
      objSmsMessage.Data   = TextMessage.Value;

      if (CheckboxUnicode.Checked == true)
      {
        objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_UNICODE;
      }
      else
      {
        objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_TEXT;
      }

      objSmsMessage.Recipient = "+31624896641";

      Submit.Disabled = true;

      obj = objSmsMessage;
      objHttpProtocol.Send( ref obj );

      Submit.Disabled = false;

      TextResult.Value = "ERROR #" + objHttpProtocol.LastError + " (" + objHttpProtocol.GetErrorDescription(objHttpProtocol.LastError) + ")";
      TextResponse.Value = objHttpProtocol.ProviderResponse;
    }
  }
}
webform.aspx.cs
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="SendSms.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
  <head>
    <title>ActiveXperts SMS and MMS Toolkit ASP.NET Sample (C#)</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  </head>
  <body>
    <font face="sans-serif" size="2">
      <hr size="1" color="#707070">
      <h2>ActiveXperts SMS and MMS Toolkit ASP.NET Sample (C#)</h2>
      <h3>Send an SMS message to a recipient through an HTTP POST SMS provider.</h3>
          IMPORTANT: For more details about using SMS and MMS Toolkit with ASP.NET: <a href="http://www.activexperts.com/support/xmstoolkit/#aspnet" target="_blank">
          SMS and MMS Toolkit ASP.NET FAQ</a>.
      <hr size="1" color="#707070">
      <br>
      <form id="Form1" method="post" runat="server">
        <table border="0" bgcolor="#f0f0f0">
          <tr>
            <td valign="top">Recipient:</td>
            <td><input size="50" type="text" value="<enter recipient number>" id="TextRecipient" runat="server" NAME="TextRecipient"></td>
          </tr>
          <tr>
            <td valign="top">Sender:</td>
            <td><input size="50" type="text" value="<enter sender number>" id="TextSender" runat="server" NAME="TextSender"></td>
          </tr>
          <tr>
            <td valign="top">Message:<br>(max. 160 chars)</td>
            <td><textarea rows="3" cols="65" id="TextMessage" runat="server" NAME="TextMessage">Hello, world</textarea></td>
          </tr>
          <tr>
            <td valign="top"> </td>
            <td><input type="checkbox" id="CheckboxUnicode" runat="server" NAME="CheckboxUnicode">Send message as Unicode</td>
          </tr>
          <tr>
            <td valign="top">Result: </td>
            <td><input size="50" type="text" id="TextResult" runat="server" NAME="TextResult"></td>
          </tr>
          <tr>
            <td valign="top">Response: </td>
            <td><input size="50" type="text" id="TextResponse" runat="server" NAME="TextResponse"></td>
          </tr>
        </table>
        <br>
        <hr size="1" color="#707070">
        <br>
        <input type="submit" value="Send Message" id="Submit" runat="server" NAME="Submit">
        <br>
        <br>
        <hr size="1" color="#707070">
      </form>
    </font>
  </body>
</html>
There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/xmstoolkit.


NOTE: Demo Projects are created with Microsoft Visual Studio 2003

The project ships with a set of Microsoft Visual Studio .NET samples, including samples for Microsoft ASP .NET C#. The projects are created with Microsoft Visual Studio 2003.
Users with a later version of Microsoft Visual Studio can open such a project. The Visual Studio Conversion Wizard will guide you through the process of converting the project to the version used.






The ActiveXperts SMS and MMS Toolkit is a SMS development component (SDK). This control can be used by any Windows development platform, including Visual Basic .NET, Visual CSharp .NET, ASP .NET (VB,CS), ASP, Visual Basic, Visual Basic for Applications (VBA), Visual Studio/Visual C++, Borland Delphi and C++ Builder, PHP, ColdFusion, HTML, VBScript and any other ActiveX/COM compliant platform. The SMS and MMS Toolkit is an ActiveXperts Software B.V. Product.

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