Sending an SMS Message with ASP.NET

Last post 12-07-2009 8:00 AM by kundasang. 14 replies.

Sort Posts:

  • Sending an SMS Message with ASP.NET

    08-15-2009, 7:38 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs

    Often times it may be a requirement for your web application to send an SMS message. Such examples would be reminders, password resetting, and spam.

    Q: Can I have some code to send an SMS message?

    A: Unfortunately it isn't as simple as just copying and pasting some code into your application and you can start blasting out text messages. SMS is a service, and cellular carriers will charge for it. The cost varies by carrier. SMS is a standard defined set of protocols that is authenticated to. When you contact a cellular company they will provide you with a username, password, gateway (sometimes called an Endpoint), and various other protocol related configurations.

    There are several existing .NET SMS SDKs out there - some are free and open source - but that doesn't change the fact that ultimately, those SDKs need endpoints configuration and you are back to the problem of needing a provider.

    Q: OK - How do I get in touch with a company to send an SMS?

    A: Most often than not it isn't feasible to contact a cellular company themselves. If you were to contact say, Verizon, you would only be able to send an SMS to Verizon phones. So you would have to partner with individual carriers - then there is the pain of figuring out which number belongs to which carrier. The easiest solution is to go to a 3rd party company that handles all of the messy work for you. This gives you an advantage of sending them in a simple manner and also not needing to know or understand how the SMPP protocol (or whatever protocol they are using - there are many) works as they will almost always provide an SDK or Web Service of their own.

    Q: What 3rd party Gateway Provider should I use?

    A: It varies by country, but a popular one that is somewhat regional is Clickatell. (Disclaimer - I do not work for them nor have I used their services - I found them via Google). They also provide their own SDK with sample code.

    Here is a list of other ones: http://www.developershome.com/sms/smsGatewayProvComp.asp

    Q: I want a vanity or custom shortcode, like 134569 instead of a phone number.

    A: That depends on the gateway provider. Clickatell allows you to rent one.

    Q: We are going to be using A LOT of SMS messages - what if I want my own gateway?

    A: If you want to setup your own gateway, then you will need some physical hardware are well as software. Kannel is a popular open source SMS Gateway that runs on Unix like operating systems. You will still need to contact an SMS Center and this does not mean you can start sending out SMS messages for free.

    Good luck with your application.

    Cheers,
           Kevin Jones


    Filed under:
  • Re: Sending an SMS Message with ASP.NET

    08-16-2009, 1:12 PM
    • Member
      105 point Member
    • tdinpsp
    • Member since 03-03-2009, 6:19 AM
    • Palm Springs, CA, USA
    • Posts 102

    If I understand you correctly you want to send a SMS message to a phone.  Provided that you know the carrier for that phone you can send it a message via email.


                            <asp:DropDownList ID="DDLCarrier" runat="server">
                                <asp:ListItem Value="@text.att.net">AT&T</asp:ListItem>
                                <asp:ListItem Value="@cingularme.com">Cingular</asp:ListItem>
                                <asp:ListItem Value="@messaging.nextel.com">Nextel</asp:ListItem>
                                <asp:ListItem Value="@messaging.sprintpcs.com">Sprint</asp:ListItem>
                                <asp:ListItem Value="@tmomail.net">T-Mobile</asp:ListItem>
                                <asp:ListItem Value="@vtext.com">Verizon</asp:ListItem>
                                <asp:ListItem Value="@vmobl.com">Virgin Mobile</asp:ListItem>
                            </asp:DropDownList>

    So if the phone number was 999-999-9999 and the carrier was Verizon then you could simply email to 9999999999@vtext.com and the message will appear on the phone as a text message.  So as long as you know the carrier of the phone number it will work.  If you don't know the carrier then I suppose you could send it to all the carriers and at least one should work.


  • Re: Sending an SMS Message with ASP.NET

    08-16-2009, 2:53 PM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs

    My post was a FAQ (Frequently asked Question) with a Q and A (Since it's in the FAQ Forum).  I wasn't really looking for an answer, just writing a post that can help others.

    Cheers,
           Kevin Jones


  • Re: Sending an SMS Message with ASP.NET

    09-17-2009, 11:59 PM
    • Member
      53 point Member
    • raghava.mrk
    • Member since 09-18-2009, 3:38 AM
    • Bangalore
    • Posts 15

    Thanks for posting this article.... It helps a lot for sending messages through asp.net pages

    Raghavakrishna Raju.M
  • Re: Sending an SMS Message with ASP.NET

    09-18-2009, 12:25 AM

    hey.... Raghakrishna Raju.M

    Buddy..I m new in asp.net and i need ur help regarding Sending SMS through Asp.net . I personally tried to work on Sms via Asp.net but could'nt get Success.. Will u please Paste ur code that u r using to Send SMS.. It would be Ur kind Aid to Me.. thanks

  • Re: Sending an SMS Message with ASP.NET

    09-23-2009, 12:57 AM
    • Contributor
      5,699 point Contributor
    • Pushkar
    • Member since 02-17-2006, 7:27 AM
    • Vibrant Gujarat
    • Posts 1,085

    Hello Sir Jones Laughing

    Thank you very much for the nice information.

    I didn't know how to send SMS in ASP.Net.

    But after read your post, i got the idea.

    Its really helpful Cool

    “ There is no great genius without some touch of madness. ”


    Remember to click “Mark as Answer” on the post If you get answer from my post(s) !

    Thanks Guys
    ------------
    Pushkar M Rathod
  • Re: Sending an SMS Message with ASP.NET

    09-23-2009, 2:59 AM

    Good Info jones

    Srinivas Bheemareddy
  • Re: Sending an SMS Message with ASP.NET

    09-26-2009, 3:53 AM
    • Member
      4 point Member
    • deboojk123
    • Member since 09-26-2009, 7:36 AM
    • Posts 2

    hello,

    Actually, i'm having this problem of sending an automated sms from my asp.net (vb) website. I'm a student and presently designing a website for my final project. The project is an intelligent car rental system that include sending an sms notification to rentals to remind them of when to return the car. 

    I've been in contact with clickatell for gateway but my problem is how to schedule the sms notification. Details of rental service will be stored in SQL database which includes the renter name, address, phone, rentdate and returningdate. So if returningdate is tomorrow, then sms notification should be sent today as a reminder.

    Please advise

  • Re: Sending an SMS Message with ASP.NET

    10-14-2009, 5:07 AM
    • Member
      2 point Member
    • realisticp
    • Member since 10-09-2009, 8:03 AM
    • Posts 1

    Hi,

    As I am one of the fresher asp.net developer ,get some usuful tips from here.

  • Re: Sending an SMS Message with ASP.NET

    10-16-2009, 7:23 AM
    • Member
      20 point Member
    • Ramesh Bandi
    • Member since 10-16-2009, 11:09 AM
    • Naidupet
    • Posts 10

    Hi Jones,

    I think I wasted so much of time on this topic but after having a look at your post I got complete idea of sending SMS through ASP.NET form.

    Thanks for the post.

  • Re: Sending an SMS Message with ASP.NET

    11-27-2009, 3:23 AM
    • Participant
      1,192 point Participant
    • linick
    • Member since 10-27-2009, 10:04 AM
    • Trivandrum
    • Posts 239

    I don't know if this is a right place ask this question. But i need a solution as early as possible.

    I am developing a web application, it includes sms sending facility.

    As per your suggestion, i thought of implementing the same with clickatell. But i am not able open up the link given.

    Did they change their site to a new address?

    Lini C K

    ========================================================================
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Sending an SMS Message with ASP.NET

    11-27-2009, 11:37 AM
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs

    As of just now, the ClickAttel link in my original post appears to still be working. Perhaps you hit it when they had some down time? 

    Cheers,
           Kevin Jones


  • Re: Sending an SMS Message with ASP.NET

    12-02-2009, 5:32 AM
    • Member
      50 point Member
    • hinaAsp.Net
    • Member since 07-21-2009, 6:18 AM
    • India
    • Posts 35

    good informationSmile 

    ---
    Hina.

    If my reply helped you, dont forget to mark it as "Answer"
  • Re: Sending an SMS Message with ASP.NET

    12-02-2009, 7:34 AM
    • Member
      32 point Member
    • spiritssoft
    • Member since 07-27-2009, 11:42 AM
    • Dharmapuri, Trichy, Madurai, Salem
    • Posts 11

    For Send SMS Through Code:

    C#.net:

    Step 1: Add Web Reference :
            http://www.spiritssoft.com/webservice/sendway2sms.asmx
    Step 2: Add This "using com.spiritssoft.www;"
    Step 3: Create a Object "SendWay2Sms smsobj = new SendWay2Sms();"
    Step 4:
            string strResult = smsobj.sendSmsSpiritsSoft("UserName", "Password", "Number", "message");
        
        strResult  : Recieving the Result from Webservice

    Note:
         - For Group SMS , Number seperated by commas(,).
         - Message should be Only 125 characters,
         - If No username , password form way2sms.com it will send message
           through Spirits Soft Technology Default Number.


    From : Spirits Soft Technology
               www.spiritssoft.com


    www.spiritssoft.com

    World Spirits
  • Re: Sending an SMS Message with ASP.NET

    12-07-2009, 8:00 AM
    • Member
      11 point Member
    • kundasang
    • Member since 05-20-2009, 4:50 AM
    • Posts 17

    is it possible for other country?

    "The most important thing is to never stop questioning."
    — Albert Einstein
Page 1 of 1 (15 items)