paulman888888 Posted April 7, 2011 Share Posted April 7, 2011 Lots of acroyms in the subject. What I would like to know is how to send a Short Message Service using "PHP: Hypertext Preprocessor" or Personal Homepage In Real Life? I've looked at Email to SMS using a gateway but can't seem to get it work. For example; [email protected] but to do luck. I've also looked at some APIs where you have to use CURL to contact there server. I've given up on this for now because I have only found hosts where you have to pay. So, a recap; How do I use PHP to send (a very short) message to a mobile phone in UK (but International would be better but not necessary)? Any free method will be great accepted. Thank-you for reading Paul Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/ Share on other sites More sharing options...
nethnet Posted April 7, 2011 Share Posted April 7, 2011 First of all, PHP *probably* isn't your best option. Sure, it can be done, but PHP lacks any inherent capabilities of handling this specifically, at least in it's current versions. Regardless, if you must use PHP to do it, realize the following: 1. You will need to know the users mobile carrier. 2. Some carriers will append ugly text to your SMS. 3. This may or may not work internationally. Essentially, you will be using the users phone number in conjunction with PHP's mail() function. You will need to use a switch statement to decide which extension to use in your "to" field, such as "@vmobl.com" for Virgin Mobile or "@vtext.com" for Verizon Wireless. Each carrier has a unique extension, so you will need to find a list of all applicable ones for your purposes. A user with a phone number of 215-555-8993 for T-Mobile would have an address of "[email protected]" Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/#findComment-1198436 Share on other sites More sharing options...
nethnet Posted April 7, 2011 Share Posted April 7, 2011 I must have missed this line when I read your message :/ I've looked at Email to SMS using a gateway but can't seem to get it work. For example; [email protected] but to do luck. I just did some research into it, and apparently this method is only viable if the number is exactly 10 digits, and if you are operating in a US gateway. Sorry for overlooking that. PHP isn't your friend in this case. Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/#findComment-1198437 Share on other sites More sharing options...
paulman888888 Posted April 8, 2011 Author Share Posted April 8, 2011 Thank-you for your answer. What language do you personally think will be best? Preferably a web based language like, ASP, JSP or Ruby. (There the languages I know but It can be completed in another language I will be more than happy to starting learning (again)) Thank-you for your answer, it really does help Paul Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/#findComment-1198608 Share on other sites More sharing options...
nethnet Posted April 8, 2011 Share Posted April 8, 2011 Well, any scripting language that supports SMTP will inherently allow SMS messaging as well, since nowadays phone numbers are (essentially) email addresses, but whether or not they have extensive support regarding this is questionable. I'd look into Coldfusion or a .NET framework. I would imagine they would be most likely to serve extended compatibility with SMS. I'd be surprised to find anything with Ruby, but I suppose there is a chance that there is a Rails library set up for doing this, since it has become a more common feature in recent years. Rails is just so... new... with regards to most other scripting frameworks, so it's a tossup really. Now that I think about it, I'm pretty sure I remember running across a full featured Coldfusion script for doing this, so that's where I'd put my money. Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/#findComment-1198655 Share on other sites More sharing options...
nethnet Posted April 8, 2011 Share Posted April 8, 2011 And if you want to get really savvy, you could rent a 5-digit phone number made specifically for handling this sort of thing and then build a nice C application around it for handling not only outgoing texts, but incoming ones as well. Quote Link to comment https://forums.phpfreaks.com/topic/233013-sms-php-irl/#findComment-1198659 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.