This is a question that I have seen posted on the boards over and over and over with no real answers on HOW you would go about sending an SMS messages from a Website.
Let me be clear about a few things real quick, like most of my posts there is no source code included in this post, just theory as I believe you wont actually learn anything if i just give you my source code as to how I achieved this.
Secondly, there are 2 ways that you can do this: an extremely cost effective way and a not so cost effective way.
I will delve into the latter of the 2 first. To send a "true" SMS message to a mobile device you need a couple of things: First you need a GSM Mobile Device (a modem essentially) directly connected to the PC you are sending the SMS message from. Now this is where it gets tricky, you need an SMS gateway, which is what the Telecos have that allows us to send SMS from our phones. You could take your SIM chip out of your phone and place it in your GSM modem to provide it access to your carriers gateway. There is only one open source SMS gateway that I know about and have included the link to it at the bottom of this Post.
In either case, you are going to have to spend money to implement this as, in so far as my research is concerned, none of the major US telecos expose API's that allow you to pass through their SMS Gateway.
Now, I was charged with creating an application that was 1) Easy to use 2) The application could send messages to any phone on any network and 3)Was cost effective.
The GSM solution fits requirements 1 and 2 but not 3. Enter Email to SMS.
Most of the major US Telecos assign an email address to each phone on their network, for example mine is [phoneNumber]@messaging.sprintpcs.com
So, for the hell of it, I sent an email from my gmail account to the above address and, sure enough, the message was delivered to my phone! The only difference between GSM and Email to SMS is that GSM will show you the phone number that sent the text message, Email to SMS shows you the email address that sent you the message.
So here is what I did:
I created a very simple application (150 lines of code) that contains a simple form with these fields:
Phone Number of recipent (textbox)
Recipents provider (dropdownlist)
Message (textarea)
Submit (button)
In a database I have the domain portion of the email addres that i pull based upon what the user selects in the provider box. (For example, if i selected SprintPCS i would pull: @messaging.sprintpcs.com from the database and just append the value of the first text box)
Then, using the System.Web.Mail namespace I build an SMTP connection to my mail server, build the mail object, and send it off to the recipent (e.g. [phonenumber]@teleco.com).
This is the only caveat really: you have to send the email using an account that exists on your mail server (unless you have changed the mail server so that the from field of the mail object can be any valid email address) so, what I did, I set up
[email protected] on my mail server so that I would not have to use my personal email account to send the messages.
So far I have tested the system with SprintPCS, Nextel, Cingular, and Altell and have a 100% success rate in delivering text messages!
Well thats about all I have, if you have any questions please post them and i will do my best to answer them.
References:
http://en.wikipedia.org/wiki/SMS_gateways
http://www.experts-exchange.com/Prog..._20333413.html
http://swik.net/SMS+Software
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature