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