fubowl Posted October 13, 2010 Share Posted October 13, 2010 I am well aware of how to send text messages using php's mail() command: <?php $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? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/ Share on other sites More sharing options...
Pikachu2000 Posted October 14, 2010 Share Posted October 14, 2010 You have to send email to a valid email address. A phone number is not a valid email address. Since number portability kicked in, there's no reliable way to deduce the carrier from the number either. Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/#findComment-1122033 Share on other sites More sharing options...
fubowl Posted October 15, 2010 Author Share Posted October 15, 2010 So you think that gmail is just sending them to every possible carrier @ once? Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/#findComment-1122421 Share on other sites More sharing options...
Pikachu2000 Posted October 15, 2010 Share Posted October 15, 2010 No. Google can well afford to send the SMS messages directly. I seriously doubt they're sending out emails to the carrier to get a message to a phone. Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/#findComment-1122461 Share on other sites More sharing options...
premiso Posted October 15, 2010 Share Posted October 15, 2010 If you want this functionality you will need to look into an SMS Server or SMS Gateway, mind you it will cost a pretty penny to get started up with it. Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/#findComment-1122522 Share on other sites More sharing options...
fubowl Posted October 16, 2010 Author Share Posted October 16, 2010 Thanks very much for your responses Pikachu2000 and premiso. Quote Link to comment https://forums.phpfreaks.com/topic/215827-possible-to-detect-sms-carrier-automatically/#findComment-1122688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.