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. Send online SMS [modified]

Send online SMS [modified]

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 2 Posters 0 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.
  • L Offline
    L Offline
    lrsalunkhe
    wrote on last edited by
    #1

    respected I am creating sms application when it is LocalHost SMS send successfully but when it online we do not send SMS My code is : public string mobile(string strcontactno, string strmesg) { try { myPage.Text = readHtmlPage(strcontactno, strmesg, "?"); return myPage.Text; } catch (Exception ex) { return myPage.Text; } } public string readHtmlPage(string strcontactno, string strmesg, string url) { string result = null; string strPost = null; string contactno = strcontactno; string message = strmesg; try { strPost = "&msisdn=" + strcontactno + "&msg=" + strmesg + "&sid=TEST&mt=0"; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; objRequest.ContentType = "application/x-www-form-urlencoded"; myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.Write(strPost); } catch (Exception e) { return e.Message; result = "-200"; } finally { if (myWriter != null) { myWriter.Close(); } } return result; } Thanks

    modified on Monday, April 26, 2010 3:31 AM

    M 2 Replies Last reply
    0
    • L lrsalunkhe

      respected I am creating sms application when it is LocalHost SMS send successfully but when it online we do not send SMS My code is : public string mobile(string strcontactno, string strmesg) { try { myPage.Text = readHtmlPage(strcontactno, strmesg, "?"); return myPage.Text; } catch (Exception ex) { return myPage.Text; } } public string readHtmlPage(string strcontactno, string strmesg, string url) { string result = null; string strPost = null; string contactno = strcontactno; string message = strmesg; try { strPost = "&msisdn=" + strcontactno + "&msg=" + strmesg + "&sid=TEST&mt=0"; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; objRequest.ContentType = "application/x-www-form-urlencoded"; myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.Write(strPost); } catch (Exception e) { return e.Message; result = "-200"; } finally { if (myWriter != null) { myWriter.Close(); } } return result; } Thanks

      modified on Monday, April 26, 2010 3:31 AM

      M Offline
      M Offline
      Michel Godfroid
      wrote on last edited by
      #2

      I voted to remove this message, because it supplies IP addresses, usernames and passwords of public websites (I just connected to it, it works fine). Please reformulate your question, omitting private information.

      1 Reply Last reply
      0
      • L lrsalunkhe

        respected I am creating sms application when it is LocalHost SMS send successfully but when it online we do not send SMS My code is : public string mobile(string strcontactno, string strmesg) { try { myPage.Text = readHtmlPage(strcontactno, strmesg, "?"); return myPage.Text; } catch (Exception ex) { return myPage.Text; } } public string readHtmlPage(string strcontactno, string strmesg, string url) { string result = null; string strPost = null; string contactno = strcontactno; string message = strmesg; try { strPost = "&msisdn=" + strcontactno + "&msg=" + strmesg + "&sid=TEST&mt=0"; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; objRequest.ContentType = "application/x-www-form-urlencoded"; myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.Write(strPost); } catch (Exception e) { return e.Message; result = "-200"; } finally { if (myWriter != null) { myWriter.Close(); } } return result; } Thanks

        modified on Monday, April 26, 2010 3:31 AM

        M Offline
        M Offline
        Michel Godfroid
        wrote on last edited by
        #3

        You'd be better off deleting your question and reposting it completely afresh. It has been downvoted a couple of times, so it will fall below the 'noise treshold' of some members (and it's grayed out anyway). So answers are unlikely... Oh, and when you repost, try enclosing code blocks with , and indent your code... Cheers,

        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