Sample GP SMS API Use With PHP

Below there is a sample code of using GP SMS Api with PHP.

function send_sms($mobile_no, $text) {
//creating a soap client
$soap=new SoapClient(“SMS WSDL.wsdl”);
//setting the variables of SendSMSRequest type
“registrationID”    =>  “YOUR USER ID”,
“password”          =>  “YOUR PASSWORD”,
“sourceMsisdn”      =>  “88017********”,
“destinationMsisdn” =>  “88”.$mobile_no,
“smsPort”           =>  7424,
“msgType”           =>  4,
“charge”            =>  0.00,//If you want you can give some value, but if you are charged, I’m not responsible for that 😛
“chargedParty”      =>  “88017********”,
“contentArea”       =>  “gpgp_psms”,
“msgContent”        =>  $text,
//The request variable
//requesting now to send sms
return $response;

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>GP SMS Api Testing</title>
//calling the function
$text=”Hi people! Just testing out! :-)”;
$response=send_sms($phone_no, $text);

P.S. : If you get any SSL related error, go to your php.ini file,find out


then delete the ; from the beginning

Update : A new updated post (with updated code) in this link: