PHP SMS API Integration Code
Integrate HighSpeedSMS into your PHP web applications, Laravel apps, or WordPress sites using PHP cURL.
<?php
// User & Gateway Credentials
$user = "XXXXXX"; // Your HighSpeedSMS username
$password = "XXXXXX"; // Your HighSpeedSMS password
$mobilenumbers = "919XXXXXXXXX"; // Enter mobile numbers (comma-separated for bulk)
$message = "Test message from PHP"; // Your message body
$senderid = "SMSCountry"; // Approved Sender ID / Header
$messagetype = "N"; // N for Normal English, U for Unicode
$DReports = "Y"; // Y for Delivery Reports
$url = "http://www.smscountry.com/SMSCwebservice_Bulk.aspx";
$message = urlencode($message);
$ch = curl_init();
if (!$ch) {
die("Couldn't initialize a cURL handle");
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, "User=$user&passwd=$password&mobilenumber=$mobilenumbers&message=$message&sid=$senderid&mtype=$messagetype&DR=$DReports");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// If you are behind a proxy server, uncomment below:
// curl_setopt($ch, CURLOPT_PROXY, "PROXY_IP_ADDRESS:PORT");
$curlresponse = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
$info = curl_getinfo($ch);
curl_close($ch);
echo "Gateway Response: " . $curlresponse;
}
?>












