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 Borland Delphi


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 Borland Delphi projects.


Step 1: Download and install The SMS and MMS Toolkit

Download 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 Delphi Project

Launch Borland Delphi (for instance 'Delphi 2005') from the Start menu. Choose 'New' from the 'File' menu and select your preferred kind of application, for instance: 'VCL Forms Application - Delphi for Win32'. A new Form is displayed in the workspace.

    
    (Click on the picture to enlarge)



Step 3: Refer to the SMS and MMS Toolkit Library and create the objects

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 SMS and MMS Toolkit objects. To do so, choose 'Import Component...' from the 'Component' menu. The Import Components' dialog appears. Select 'Import a Type Library':

    
    (Click on the picture to enlarge)

In the 'Registered Type Libraries' page, select ActiveXperts SMS and MMS Toolkit Type Library' and click 'Next':

    
    (Click on the picture to enlarge)

In the 'Components' page, leave all fields default and click 'Next':

    
    (Click on the picture to enlarge)

In the 'Install' page, select 'Create Unit' and click 'Next':

    
    (Click on the picture to enlarge)

The interface code is generated now and is shown in the AXmsCtrl_TLB tab of the project.



Step 4: Declare and create the object

From the Project Manager, open Unit1.bas and add the AXmsCtrl_TLB to the 'Uses' statement to refer to the SMS Toolkit library:

    
    (Click on the picture to enlarge)

In the 'private' or 'public' section, declare the following objects:
   objHttpProtocol  : ISmsProtocolHttp
   objSmsMessage    : ISmsMessage
   objSmsConstants  : IConstants
You can now create the objects, for instance in the 'FormCreate' function:
   objSmsProtocolHttp := TSmsProtocolHttp.Create(Form1).DefaultInterface;
   objSmsMessage      := TSmsMessage.Create(Form1).DefaultInterface;
   objSmsConstants    := TSmsConstants.Create(Form1).DefaultInterface;


Step 5: Send and/or receive SMS messages

You can now send and/or receive SMS messages.

The following code shows how to send an SMS message unsing an SMPP provider:
unit SendSmsForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, AXmsCtrl_TLB, StdCtrls, OleServer, ComCtrls, ShellAPI, ExtCtrls;

type
  TForm1 = class(TForm)

    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    editServer: TEdit;
    editPort: TEdit;
    editSystemID: TEdit;
    editPassword: TEdit;
    editSystemType: TEdit;
    buttonConnect: TButton;
    buttonDisconnect: TButton;
    Label6: TLabel;
    Label7: TLabel;
    EditRecipient: TEdit;
    EditMessage: TEdit;
    ButtonSend: TButton;
    CheckUnicode: TCheckBox;
    CheckMultipart: TCheckBox;
    CheckFlash: TCheckBox;
    Label8: TLabel;
    Label9: TLabel;
    ListView1: TListView;
    Button1: TButton;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    EditResult: TEdit;
    EditLogfile: TEdit;
    ButtonView: TButton;
    Timer1: TTimer;
    Label15: TLabel;
    procedure buttonConnectClick(Sender: TObject);
    procedure linkClick(Sender: TObject);
    procedure buttonDisconnectClick(Sender: TObject);
    procedure ButtonSendClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    function GetResult : Integer;
    procedure QueryMessages;
    procedure ButtonViewClick(Sender: TObject);
    procedure OnTimer(Sender: TObject);

  private
    objHttpProtocol  : ISmsProtocolHttp
    objSmsMessage    : ISmsMessage
    objSmsConstants  : IConstants
  public
    { Public declarations }
  end;

var
  Form1: TForm1;


implementation

{$R *.dfm}

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.buttonConnectClick(Sender: TObject);
begin

  objHttpProtocol.LogFile         := editLogfile.Text;
  objHttpProtocol.Server          := editServer.Text;
  objHttpProtocol.ServerPort      := StrToInt ( editPort.Text );
  objHttpProtocol.SystemID        := editSystemID.Text;
  objHttpProtocol.SystemPassword  := editPassword.Text;
  objHttpProtocol.SystemType      := editSystemType.Text;
  objHttpProtocol.SystemMode      := objSmsConstants.asSMPPMODE_TRANSMITTER;

  objHttpProtocol.Connect;

  if GetResult = 0 Then
  begin
    ButtonConnect.Enabled     := false;
    ButtonDisconnect.Enabled  := true;
    ButtonSend.Enabled        := true;
    EditRecipient.Enabled     := true;
    EditMessage.Enabled       := true;
    Timer1.Enabled            := true;
  end;
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.linkClick(Sender: TObject);
begin
  ShellExecute ( 0, 'open' , 'http://www.activexperts.com', '', '', SW_SHOW )
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.buttonDisconnectClick(Sender: TObject);
begin
  objHttpProtocol.Disconnect;

  ButtonConnect.Enabled     := true;
  ButtonDisconnect.Enabled  := false;
  ButtonSend.Enabled        := false;
  EditRecipient.Enabled     := false;
  EditMessage.Enabled       := false;
  Timer1.Enabled            := false;
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.ButtonSendClick(Sender: TObject);
var
  Item : TListItem;
begin
  if objHttpProtocol.IsConnected = -1 then
  begin
    objSmsMessage.Data := EditMessage.Text;
    objSmsMessage.Recipient := EditRecipient.Text;

    if ( CheckUnicode.Checked = true ) then
    begin
      if ( CheckMultipart.Checked = true ) then
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_UNICODE_MULTIPART;
      end
      else
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_UNICODE;
      end;
      if ( CheckFlash.Checked = true ) then
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_UNICODE_FLASH;
      end;
    end
    else
    begin
      if ( CheckMultipart.Checked = true ) then
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_TEXT_MULTIPART;
      end
      else
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_TEXT;
      end;
      if ( CheckFlash.Checked = true ) then
      begin
        objSmsMessage.Format := objSmsConstants.asMESSAGEFORMAT_TEXT_FLASH;
      end;
    end;




    objHttpProtocol.Send( objSmsMessage );

    if GetResult = 0 Then
    begin
      Item := ListView1.Items.Add;
      Item.Caption := objHttpProtocol.MessageReference;
      Item.SubItems.Add ( objSmsMessage.Recipient );
      Item.SubItems.Add ( 'N/A' );
      Item.SubItems.Add ( 'Submitted' );
    end;
  end;
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.FormCreate(Sender: TObject);
 begin
  objSmppProtocol := TSmsProtocolSmpp.Create(From1).DefaultInterface;
  objSmsMessage := TSmsMessage.Create(From1).DefaultInterface;
  objSmsConstants := TSmsConstants.Create(Form1).DefaultInterface;
end;

////////////////////////////////////////////////////////////////////////////////

function TForm1.GetResult : Integer;
begin
  Result := objHttpProtocol.LastError;

  EditResult.Text     := 'ERROR ' + IntToStr ( Result ) +  ' : ' + objHttpProtocol.GetErrorDescription( Result );
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.ButtonViewClick(Sender: TObject);
var LogFile : PAnsiChar;
begin
  LogFile := StrNew(PChar(editLogFile.Text));

  ShellExecute ( 0, 'open' , LogFile, '', '', SW_SHOW )

end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.OnTimer(Sender: TObject);
begin
  if objHttpProtocol.IsConnected = -1 Then QueryMessages;
end;

////////////////////////////////////////////////////////////////////////////////

procedure TForm1.QueryMessages;
var
Count : Integer;
i     : Integer;
Item  : TListItem;
Status: Integer;
begin
  Count := ListView1.Items.Count;

  for i:= 0 to Count - 1 do
  begin
      Item := ListView1.Items.Item [ i ];

      if Item.SubItems.Strings [ 1 ] = 'N/A' then
      begin
        objHttpProtocol.MessageReference := Item.Caption;
        objHttpProtocol.QueryStatus;

        if GetResult = 0 then
        begin
          Status := objHttpProtocol.StatusCode;
          Item.SubItems.Strings [ 2 ] := objHttpProtocol.GetStatusDescription( Status );
          if Status > 1 Then Item.SubItems.Strings [ 1 ] := objHttpProtocol.StatusTime;
        end;
     end;
  end;
end;

////////////////////////////////////////////////////////////////////////////////

end.
   
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 Borland Delphi 7

The SMS and MMS Toolkit project ships with a set of samples for Borland Delphi. The projects are created with Borland Delphi 7.
Users with a later version of Borland Delphi 7 can open such a project. The Borland 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.