I figured this out the other day and thought it would be a good idea to pass on. SMS messages are just sent to special email addresses, so they can be sent from server to phone with minimal effort. Here is the form and handler, feel free to copy or modify it in any way you see fit:
Sending a text message to a cell phone through PHP is just a matter of appending the correct suffix to the number and using the mail() function. If you want to add more carriers, go here and find the carrier you are looking for. If you do not know the carrier (ie. if you want to add a "not sure" option to the pulldown menu), add @teleflip.com as the suffix. The phone numbers must be 10 digits long (XXX-XXX-XXXX).
Feel free to contact me if you are having any trouble,
The Yembo Project
I tried the email deal, first email got no response or text, second got bounced back with the message: "this does not appear to be a valid north american phone number", so I'm guessing only U.S. no.s right?
If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
The same applies to HTML and the forums [HTML][/HTML] tags.
I don't have time to try this now, but if this works for someone let me know. If it works I might write a little Adobe Air app when I get time to text message people from my computer at work (without an IM client).
unfortunately, this solution makes a lot of assumptions (each phone number can be reached at an email address, service providers allow for bulk emails in this fashion, etc) that just aren't true everywhere, even inside the US.
I have had an sms form on my site for a while. The problem I run into is that many sms relays only support limited header info, which means that creating a message that can be "Replied To:" reliably when it was created from a web form is sketchy...but sending the message has worked well.
You can scale back on the coding by concatenating the number to the carrier from the web form, then the php script just ties the two together:
A few years ago I worked with for a company that developed a service with Vodafone in the UK on a reverse billing text chat service that made the company (and Vodafone) a small fortune. We paid about 4p a text and charged a lot more depending gong the service.
If you're interested in using SMS reliably you need a contract and a gateway,. For us back then it worked like this (in the UK). We advertised a short code like 8008 and a key word like 'chat' so the ad would run saying text 'chat' to 8008. The text went to Vodafone and they http posted it to us via their gateway. We stored the number in our database and used either a human operator or robot to reply (again depending on the service) using http to send to the gateway. The user would reply to the text directly and the gateway would again send through to us with their message. We wrote an interface that organized the messages for reply. It was quite a laugh as no-one had a service like that back then (around 2000) but when they also wanted an adult service the message logs became very very scary. I thought I could sue for emotional damage after a few of them.
They charged about one pound fifty a text and here's how 90% of adult the conversations went.
Welcome, send you message to start chatting.
Hi whats your name?
Sally how are things with you?(1.50)
Not bad, are you feeling horny?
you bet, how about you?(1.50)
Great, what do you look like?
Blond, Petite, big boobs (1.50)
Do you take it up the arse?
You're a bit forward aren't you, is that what you like?(1.50)
That's why we wrote the robot. almost every one did the same thing and asked that same question so we though why pay a team of people when we can bot it. It didn't affect the monthly revenue at all.
We had one woman call in irate that we had show up on her bill. My boss was a very cool guy and tried to clam her down while we looked into the message logs. The call went like this
Rant... tirade.. how dare you...refund ....lawsuit etc
We don't know how it could happen it's a subscription service.
rant ... fume...
Does anyone have access you your phone
no, husband has his own ... seethe .... scream
(we check logs)
(He puts her on speaker for the whole office.)
Is your husbands name David?
Because we have these messages ('my name Davids... messages descend into filth)
....silence.....OK thank you, goodbye.
Dam if that wasn't the funniest day in a very fun place to work!
Last edited by SyCo; 11-07-2008 at 03:27 PM.
Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.
Sir, how about the opposite way. From cell to website. e.g. if the user send message, then in the website, there is a part where all the messages can be view. Any idea how to do this? i am also in search of same code can u pls tell me that it possible if yes the pls provide guid line for it .Is there any requirement of hardware or have to purchase any packages