Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 45 lines (37 sloc) 1.415 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<?php

include_once('Lite_SMS.class.php');

//Example usage, istantiate with sender email
$sms = new Lite_SMS('sender@domain.com');

// Add various provider, US in example
$carriers = array(
"ATT" => array("mms" => "mms.att.net" ),
"Boost Mobile" => array( "mms" => "myboostmobile.com" ),
"Cricket" => array("mms" => "mms.mycricket.com" ),
"Sprint" => array("mms" => "messaging.nextel.com" ),
"T-Mobile" => array( "mms" => "tmomail.net","sms"=> "tmomail.net" ),
"Verizon" => array( "mms" => "vzwpix.com" ),
"Virgin Mobile" => array( "mms" => "vmpix.com" ),
"MetroPCS" => array( "sms" => "mymetropcs.com" ),
"TracFone" => array( "sms" => "mmst5.tracfone.com" )
);

/*
Create a select menu for user selecting SMS provider.
Ideal for adding SMS to free apps, allowing users with
listed carriers to receives SMS updates.
*/
$options = "<select name=\"carrier\">\n";

// Loop through carriers and add each carrier to instance
foreach($carriers as $carrier => $types){
foreach($types as $type => $domain){
$sms->addCarrier($carrier,$domain,$type);
}
// Create option for carrier
$options.= "<option value=\"{$carrier}\">$carrier</option>\n";
}
$options .= "<\select>\n";

// Echo options
echo $options;

// Set message for text
$message = "Don't forget to check out my latests posts!";

// Send text with appropriate provider and message
$sms->send('15593029917','TracFone',$message);
Something went wrong with that request. Please try again.