Home » , » Send Free SMS To Any Grameen Phone Number Using AloAshbei API

Send Free SMS To Any Grameen Phone Number Using AloAshbei API

Short Messaging Service (SMS) is a great way of communication now-a-days. There are so many websites online which provides service to send free SMS worldwide. But most of them don’t support Bangladesh or has some limits. Here I am going to share you a PHP Code snippet by which you’ll be able to send free SMS to any Grameen Phone number.


Send Free SMS Using AloAshbei API

<!DOCTYPE html>
<html>
<body>
<title>FREE SMS Sender</title>

<?php
if(isset($_POST['submit']))
{

$soap = new SoapClient("http://www.wpcypher.com/wsdl.wsdl");

$a['registrationID'] = ''; //AloAshbei Username
$a['password'] = ''; //AloAshbei Password
$a['sourceMsisdn'] = ''; //AloAshbei Developer Test Phone Number
$a['smsPort'] = 5001;
$a['msgType'] = 4;
$a['charge'] = 0.00 ;
$a['contentArea'] = 'gpgp_psms';
$a['destinationMsisdn'] = $_POST['sendto'];
$a['msgContent'] = $_POST['msg'];

$result = $soap->sendSMS(array("SendSMSRequest" => $a));

if ($result->SendSMSResponse->status == 'OK')
{
echo '<h2>Message Sent!</h2>';
}
else
{
echo "<h2>" . $result->SendSMSResponse->status . "</h2>";
}

}
else
{
?>

<p align="center">SEND FREE SMS (ONLY TO GP)</p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<small>Send To: (Ex. 88017XXXXXXXX)<br/></small>
<input name="sendto" type="*N" maxlength="13" /><br/>
<small>Message: (Max. 160 Chars.)<br/></small>
<input name="msg" type="text" maxlength="160" /><br/>
<input type="submit" name="submit" value="Send" /><br/>
</form>

<?php
}
?>

</body>
</html>


Usage

1. Create an AloAshbei Account: https://www.aloashbei.com.bd/user/register

2. Login to your account and then select ‘Edit Profile‘.

3. There you’ll find an option named ‘Developer Test Phone‘.

4. Add your Grameen Phone number there and a verification code will be sent to your number.

5. Verify the number using the verification code and you’re done! Then your number will be added to the account.

6. Now you have to edit the above code and put your AloAshbei Account Information here:
$a['registrationID'] = ''; //Your AloAshbei Username
$a['password'] = ''; //Your AloAshbei Password
$a['sourceMsisdn'] = ''; //Your AloAshbei Developer Test Phone

7. Save the code in a .php file and upload it to your server.

8. You have to enable the following PHP Extensions on your server to make this script work: php_soap, php_openssl

9. You also need the wsdl.wsdl file. It is called from my server in the sample code. If you want you can download it and host it on your own server.

You can only send SMS to Grameen Phone number using this script as it uses the Grameen Phone AloAshbei API.

If you face any problem to run this script; let me know in the comment.

Hope you’ll enjoy it and thanks goes to Abu Ashraf Masnun for his work.
Share this article :

0 comments:

Post a Comment

THANKS FOR YOUR CO-OPERATION:

 
Copyright © 2008-2015. Deshi Tunes:: Your most important blogging platform for Tips and Tricks... - All Rights Reserved
Template Modify by DTunes Apps