Quicklinks
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:
SMS Messaging Server can be well integrated into PHP environments. This document describes how the SMS Messaging Server can be integrated into PHP projects.
Download ActiveXperts SMS Messaging Server from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
Create a new PHP script called index.php in the root directory of IIS or Apache, using your favorite editor. On top of the PHP code, insert the following lines to declare and create the SMS Messaging Server API objects:
$objConstants = new COM ( "Axsms-messaging-server.Constants" ); $objMessageDB = new COM ( "Axsms-messaging-server.MessageDB" );
You can now send an SMS messages.
The following PHP code shows how to create an SMS message:
<html>
<head>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<title>ActiveXperts SMS Messaging Server PHP Sample</title>
</head>
<body>
<?php
$objConstants = new COM ( "Axsms-messaging-server.Constants" );
$objMessageDB = new COM ( "Axsms-messaging-server.MessageDB" );
$objMessageDB->Open ();
if ( $objMessageDB->LastError <> 0 )
{
$ErrorDes = $objMessageDB->GetErrorDescription ( $objMessageDB->LastError );
die ( $ErrorDes );
}
$objMessage = $objMessageDB->Create ();
if ( $objMessageDB->LastError <> 0 )
{
$ErrorDes = $objMessageDB->GetErrorDescription ( $objMessageDB->LastError );
die ( $ErrorDes );
}
$objMessage->Direction = $objConstants->MESSAGEDIRECTION_OUT;
$objMessage->Type = $objConstants->MESSAGETYPE_SMS;
$objMessage->Status = $objConstants->MESSAGESTATUS_PENDING;
$objMessage->ChannelID = 0;
$objMessage->ScheduledTime = "";
$objMessage->Recipient = "+31625044454";
$objMessage->Body = "SMS Messaging Server - PHP Test SMS";
// Save the Message
$objMessageDB->Save ( $objMessage );
if ( $objMessageDB->LastError <> 0 )
{
$ErrorDes = $objMessageDB->GetErrorDescription ( $objMessageDB->LastError );
die ( $ErrorDes );
}
Echo "Successfully created new SMS Message";
?>
</body>
</html>