Sending sms using php and mvaayoo API

Hello Friend, This Post is all about sending sms from the website using php code and mvaayoo API for sending sms. Mvaayoo is a sms gateway for sending sms. Using It  user can send bulk sms  in php send text message.

Sending sms using php

  Top SMS Getway In India

  1. Mvaayoo 
  2. horizone sms
  3. smsindiahub
  4. smszone
  5. way2mint
  1. First You Need to create account in mvaayoo site.

DEMO File

<?php 
	if(isset($_POST["submit"]))
	{
		//echo "submitted";
		$mno = $_POST["mno"];
		$message =  $_POST["message"];
		if(preg_match( '/^[A-Z0-9]{10}$/', $mno) && !empty($message)) {
			$ch = curl_init();
			$user="Your Email And Password";
			$receipientno= $mno; 
			$senderID="TEST SMS"; 
			$msgtxt= $message; 
			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 $buffer;
				echo 'Message Send.';
			} 
			curl_close($ch);
		} else {
			echo 'Not Valid Information';
		}
	}
?>

<html>
	<head>
		<title>SMS Sending Using PHP and Mvaayoo API</title>
	</head>
	<body align="center">
	<h1>SMS Sending Using PHP and Mvaayoo API</h1>
		<form action="" method="post">
			  Enter mobile no<br>
			  <input type="text" name="mno"><br>
			  Message<br>
			  <textarea type="text" name="message"></textarea><br>
			  <br>
			  <input type="submit"  name="submit" value="Send"/>
		</form>
		<h3>Total Remaining SMS</h3>
		<?php 
			$ch = curl_init();
			curl_setopt($ch,CURLOPT_URL,  "http://api.mvaayoo.com/mvaayooapi/APIUtil");
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, "Your Email And password&type=0");
			$buffer = curl_exec($ch);
			echo $buffer;
			curl_close($ch);
		?>

		<h3 style="color:red"> www.TechsoftTutorials.com</h3> 
	</body>
</html>

Output: