Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Bulk SMS Script
include_once "alfa.sms.class.php";
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
$sql = "SELECT mobilenumber from Tablename";
$phone_nos = $conn->query($sql);
$sms=new AlfaSMS();
$text_message = "Hi from Alfred :)";
foreach($phone_nos as $phone_no)
echo "SMS sent sucessfully to $phone_no”;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment