Jump to content

SMS & PHP IRL


paulman888888

Recommended Posts

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; number@mobile-vendor.tlc 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

Link to comment
Share on other sites

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 "2155558993@tmomail.net"

Link to comment
Share on other sites

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; number@mobile-vendor.tlc 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.  :D

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.

Guest
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.