Send free Sms API & SMS gateway integration
by Prabakaran[ Edit ] 2012-12-25 12:30:24
<div style='margin:0 auto;width:300px;'>
<?php
if($_POST){
$ch = curl_init();
$user=""; // here to use Username & password for mvaayoo.com for ex 'test@gmail.com:test2012'
$receipientno=$_POST['phno']; // To send whose no
$msgtxt=$_POST['msg']; // Here your message
$senderID="TEST SMS";
curl_setopt($ch,CURLOPT_URL, "http://api.mVaayoo.com/mvaayooapi/MessageCompose");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&senderID=$senderID&receipientno=$receipientno&msgtxt=$msgtxt");
$buffer = curl_exec($ch);
if(empty ($buffer)){
echo " Buffer is empty..... ";
}else{
echo "Message Sent Successfully.....";
}
curl_close($ch);
}
?>
<br><br><br>
<form name='sms' action='' method='post'>
Phone number:<br/><input type='text' name='phno' value='' maxlength=10/>
<br/>
Message : <br/><textarea rows=5 cols=30 name='msg'></textarea>
<br/>
<input type='submit' value='Send'>
</form>
</div>