Sending SMS from C# .net
-
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
-
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
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
-
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
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.
-
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.
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
-
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
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.