Send SMS Messages Using Delphi and SMS Messaging Server
Send SMS Messages Using Delphi and SMS Messaging Server
ON 1/1/2020, AURON SOFTWARE B.V. ACQUIRED ACTIVEXPERTS SMS MESSAGING SERVER AND WILL CONTINUE
DEVELOPING, SELLING AND SUPPORTING THE PRODUCT UNDER IT'S OWN BRAND NAME AURON SMS SERVER.
MAINTENANCE CONTRACTS WILL BE CONTINUED DIRECTLY BY AURON SOFTWARE AS OF 1/1/2020.
CREATE AN SMS MESSAGE USING THE SMS MESSAGING SERVER API - DELPHI
Introduction
In this example we are going to create a Delphi sample page to create an SMS using the ActiveXperts SMS Messaging Server API. The SMS Messaging Server service will send
the message you created in the database.
Download ActiveXperts SMS Messaging Server from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
Launch Borland Delphi from the Start menu. In our example we use Delphi 2010. Choose 'New' from the 'File' menu and select your preferred kind of application, for instance: 'VCL
Forms Application - Delphi'. A new Form is displayed in the workspace.
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 Library in the project to be able to use the SMS Messaging Server 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 Messaging Server Type Library' and click 'Next':
In the 'Components' page, leave all fields default and click 'Next':
(Click on the picture to enlarge)
The interface code is generated now and is shown in the AXMMCFGLib_TLB tab of the project.
From the Project Manager, open Unit1.bas and add the AXMMCFGLib_TLB to the 'Uses' statement to refer to the SMS Messaging Server Library:
(Click on the picture to enlarge)
objMessageDB : IXMessageDB;
objConstants : IXConstants;
You can now create the objects, for instance in the 'FormCreate' function:
objMessageDB := CoXMessageDB.Create();
objConstants := CoXConstants.Create();
The following code will save the SMS message into the database:
The following code shows how to send an SMS message using the SMS Messaging Server API:
{******************************************************************************}
{ }
{ ActiveXperts }
{ }
{ SMS Messaging Server: create SMS }
{ }
{******************************************************************************}
program CreateEMAIL;
{$APPTYPE CONSOLE}
uses
SysUtils, ActiveX,
AXMMCFGLib_TLB in '..\typelib-imports\AXMMCFGLib_TLB.pas';
{= V A R I A B L E S ==========================================================}
var
objMessageDb : XMessageDB;
objConstants : XConstants;
strRecipient, strBody:string;
objMessage: XMessage;
vt:OleVariant;
{= P R O G R A M ==============================================================}
begin
// Create API objects
objMessageDB := CoXMessageDB.Create();
objConstants := CoXConstants.Create();