Sample code – SOAP using PHP

The following sample code shows, how send sms using PHP and SOAP interface:


class Message {
 function Message($ToPhonenumbers, $MessageText) {
 $this->ToPhonenumbers=new SoapVar($ToPhonenumbers, null, null, null, null, "");
 $this->MessageText=new SoapVar($MessageText, null, null, null, null, "");


$client = new SoapClient($url, array("trace" => 1)); //you only need trace if you want to se the request

$message=new Message("+45XXXXXXXX","Test message");

$params=array('AccountName' => $accountName, 'AccountPassword' => $password, 'Message' => new SoapVar($message, SOAP_ENC_OBJECT));

//below is only for debugging purpose

echo "<br><br>Request:<br>";

echo "<br><br>Response:<br>";

It is nessasary to change the parametres, so that they do match the username and Password, you recieved when opening your SureSMS account!

Code is courtesy of Erik Nielsen!

Need an account?

Do you still need an account or a free test account? Follow this link and we will make you one in 5 minuts.