Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2006, 11:16 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default SOLUTION: HowTo Send SMS Messages

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
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old December 16th, 2006, 05:25 PM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey, I have a quick question: is there any way to hide the email sent from when you use the email to SMS way?

Thanks.

 
Old December 17th, 2006, 12:17 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hide it, no. The email address the SMS message is getting sent from is attached to the SMS message itself. Of course, if your mail server allowed you to have a blank email address or something to that effect, yes you could.

-------------------------
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
 
Old August 13th, 2007, 11:21 AM
Registered User
 
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also try using an SMS webserice as listed on our website's developer section.

Dan,
http://www.freebiesms.co.uk

 
Old August 19th, 2007, 05:13 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Depends on whether you want to send SMS using a connected GSM modem, or using a TCP protocol like HTTP or SMPP.

The following website should get you starting developing SMS, please see the tutorials section

http://www.smssolutions.net

Leon

 
Old September 1st, 2007, 12:15 PM
Registered User
 
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also try one of the following services... They have great Tools...
http://www.meine-sms.com
http://www.2sms.com

 
Old November 13th, 2007, 02:17 AM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's some links which will be useful to further your understanding in SMS Gateway software/systems:

1. SMS tutorial - http://www.visualtron.com/wire_sms_index.htm

2. How to encode SMS - http://www.dreamfabric.com/sms

3. Simple SMS Sender Software (uses GSM phones) - http://www.visualtron.com/products_vgsmlite.htm

4. Test GSM device and phone using Hyperterminal - http://www.visualtron.com/tutorial06.htm

Hope they will be useful.

Rgds,
SMS Gateway Expert
http://www.visualtron.com
 
Old August 29th, 2008, 01:47 AM
Authorized User
 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to manojbhoyar Send a message via Yahoo to manojbhoyar
Default

i got every thing you mention in your article about sms sending and thnaks for that.
but i question is annoying me is that why we do need GSM modem to accomplish this task.
Can't it be as simple as other web application.
I mean my web application are running on server.(its reguler server where we host web site).
And i want to add functionality of sms in one of the web form of application.Here Where does GSM modem come from?
Any one who access this web form should be enable to send sms.
I don't know wheater all i mentioned make any sense or not.
But Please help me to clear my idea.



 
Old August 29th, 2008, 11:38 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

I wish the WROX books didn't come with source code. I can't learn a thing from them.

 
Old August 29th, 2008, 12:16 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Quote:
quote:Originally posted by rstelma
 I wish the WROX books didn't come with source code. I can't learn a thing from them.

What does this have to do with this thread?

manojbhoyar: As I pointed out in my original post, you don't NEED a GSM modem but it is one of the two ways I have found to send SMS messages.

The reason why you would need a GSM modem if you did not want to use the email route is because, as far as I know, the Network Providers (Sprint, ATT, etc) do not provide a gateway through which you can send SMS directly. Also, when you use the email approach, the recipient of the message will have some form of email address in the "From" field of the SMS as opposed to a phone number; a GSM modem would allow you to populate the From field with some form of number.

hth,
-Doug

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send URL request to send sms via NowSMS deco BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 February 16th, 2008 02:45 PM
how to send sms compad Beginning VB 6 0 July 19th, 2007 03:04 AM
using a sql db to send sms messages/emails Adam H-W SQL Server 2000 0 April 13th, 2006 05:46 AM
Send SMS albinjoseph Pro JSP 3 November 6th, 2005 03:18 PM
How to send SMS mistry_bhavin General .NET 0 February 5th, 2005 03:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.