Jump to content

Possible to detect SMS carrier automatically?


Recommended Posts

I am well aware of how to send text messages using php's mail() command:


$from = $_POST['from'];
$to = $_POST['to'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);

if ((empty($from)) || (empty($to)) || (empty($message))) {
header ("Location: sms_error.php");

else if ($carrier == "verizon") {
$formatted_number = $to."@vtext.com";
mail("$formatted_number", "SMS", "$message"); 
// Currently, the subject is set to "SMS". Feel free to change this.

header ("Location: sms_success.php");

else if ($carrier == "tmobile") {
$formatted_number = $to."@tmomail.net";
mail("$formatted_number", "SMS", "$message");

header ("Location: sms_success.php");

else if ($carrier == "sprint") {
$formatted_number = $to."@messaging.sprintpcs.com";
mail("$formatted_number", "SMS", "$message");

header ("Location: sms_success.php");


My question however, is if anyone knows how to detect the carrier automatically WITHOUT input from the user. I know gmail allows the ability the only enter the phone number and it goes to the correct carrier, but how do they do this without knowing the carrier? Do they simply send the sms to each carrier or do they have the knowhow to send it to the carrier based on the phone number itself?



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.