Tuesday, February 22, 2011

how to send and receive sms using php code?

You can now send and/or receive SMS messages.

The following PHP code shows how to send a SMS message through a SMPP provider:

html
head
meta HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8"
titleActiveXperts SMS and MMS Toolkit PHP Sample title
head
body
font face="sans-serif" size="2"
hr size="1" color="#707070"
font size="4"ActiveXperts SMS and MMS Toolkit PHP Sample font




Send an SMS message to a recipient through an SMPP connection.




hr size="1" color="#707070"



Server = "smpp.activexperts-labs.com";
$objSmppProtocol->ServerPort = 2775;
$objSmppProtocol->SystemID = "ax004";
$objSmppProtocol->SystemPassword = "812056";
$objSmppProtocol->SystemType = "SMPP";

$objSmppProtocol->Logfile = "c:\\PhpSmppLog.txt";
$objSmppProtocol->ServerTimeout = 5000;
$objSmppProtocol->SystemMode = 1;

$objSmsMessage->Recipient = "+31647134225";
$objSmsMessage->Data = "Hello World, SMS Message From PHP";
$objSmsMessage->Format = 0;


$objSmppProtocol->Connect();

if ( $objSmppProtocol->LastError == 0 )
{
$objSmppProtocol->Send( objSmsMessage );
}

if ( $objSmppProtocol->LastError == 0 )
{
Echo "Message successfully submitted.";
}
else
{
$ErrorNum = $objSmppProtocol->LastError;
$ErrorDes = $objSmppProtocol->GetErrorDescription ( $ErrorNum );

Echo "Error sending message: #$ErrorNum ($ErrorDes).";
}

$objSmppProtocol->Disconnect();
?>
hr size="1" color="#707070"
font size="1" face="Verdana" This demo uses the ActiveXperts SMS and MMS Toolkit, an a href="http://www.activexperts.com" ActiveXperts Software a product.font
body
html

2 comments:

  1. However, we provide ready to use bulk SMS API code in PHP programming language that is helpful to send various information to people through SMS. Our sample codes API scripts in PHP is very reliable, powerful and easy to integrate into the software. We also provide a detailed document of bulk SMS API PHP to send bulk SMS in a minute of a time.

    ReplyDelete
  2. Demorei para ler todos os comentários, mas gostei muito do artigo. Provou ser muito útil para mim e estou certo para todos os comentaristas aqui! É sempre bom quando você pode não apenas estar informado, mas também se divertir! \espionar sms de outro celular gratis

    ReplyDelete