Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sending SMS from C# .net

Sending SMS from C# .net

Scheduled Pinned Locked Moved ASP.NET
csharphelpdatabasequestion
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hema Bairavan
    wrote on last edited by
    #1

    Hi, I am trying to send a text message to mobile from C#, i googled and found one piece of coding but its throwing error.. UriBuilder urlBuilder = new UriBuilder(); urlBuilder.Host = "127.0.0.1"; urlBuilder.Port = 8800; string PhoneNumber = "919894911514"; string message = "Just a simple text"; urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "& Text=" + message); HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), false)); HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse()); the error is No connection could be made because the target machine actively refused it 127.0.0.1:8800 am i doing correct? help me

    D D 2 Replies Last reply
    0
    • H Hema Bairavan

      Hi, I am trying to send a text message to mobile from C#, i googled and found one piece of coding but its throwing error.. UriBuilder urlBuilder = new UriBuilder(); urlBuilder.Host = "127.0.0.1"; urlBuilder.Port = 8800; string PhoneNumber = "919894911514"; string message = "Just a simple text"; urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "& Text=" + message); HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), false)); HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse()); the error is No connection could be made because the target machine actively refused it 127.0.0.1:8800 am i doing correct? help me

      D Offline
      D Offline
      Deepak the Cool
      wrote on last edited by
      #2

      First thing to noticed about that your 127.0.0.1 is a sms server or your mobile device connected machine's IP. I think Your mobile device not connected to given IP machine.

      Deepak :) Smile a Lots,Its Costs Nothing

      1 Reply Last reply
      0
      • H Hema Bairavan

        Hi, I am trying to send a text message to mobile from C#, i googled and found one piece of coding but its throwing error.. UriBuilder urlBuilder = new UriBuilder(); urlBuilder.Host = "127.0.0.1"; urlBuilder.Port = 8800; string PhoneNumber = "919894911514"; string message = "Just a simple text"; urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "& Text=" + message); HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), false)); HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse()); the error is No connection could be made because the target machine actively refused it 127.0.0.1:8800 am i doing correct? help me

        D Offline
        D Offline
        Dinesh Mani
        wrote on last edited by
        #3

        The code in general is correct, except for the URL part. 127.0.0.1 refers to local host and is used here as a reference. You need to replace it with the URL of some service that can process this request.

        H 1 Reply Last reply
        0
        • D Dinesh Mani

          The code in general is correct, except for the URL part. 127.0.0.1 refers to local host and is used here as a reference. You need to replace it with the URL of some service that can process this request.

          H Offline
          H Offline
          Hema Bairavan
          wrote on last edited by
          #4

          thanks mr dinesh, if you dont mind and if you know the URL which process the same request please tell me. and i have gone through this link http://www.c-sharpcorner.com/UploadFile/scottlysle/TextMsgToCellPhone12112006002339AM/TextMsgToCellPhone.aspx[^] and i have seen in some other examples also that sending mail to mobilenumber@serviceprovider.com really will the message go if we send message like this?? please clarify

          D 1 Reply Last reply
          0
          • H Hema Bairavan

            thanks mr dinesh, if you dont mind and if you know the URL which process the same request please tell me. and i have gone through this link http://www.c-sharpcorner.com/UploadFile/scottlysle/TextMsgToCellPhone12112006002339AM/TextMsgToCellPhone.aspx[^] and i have seen in some other examples also that sending mail to mobilenumber@serviceprovider.com really will the message go if we send message like this?? please clarify

            D Offline
            D Offline
            Dinesh Mani
            wrote on last edited by
            #5

            I don't know any such services, but I assume a Google search should give you a lot of options. But, most services would require you to become a member before you can use their service. But, there should be other ways to do it than doing it via HTTP Web request/response. Just think of other means as well.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups