通过我们的网站将短信发送到手机时出现问题

问题描述:

我正在使用以下脚本通过我们的网站发送短信,但是它不起作用.短信未发送.有人可以帮我解决这个问题吗?

I am using the following script for sending sms through our website, but it does not work. The sms is not sent. So can anyone help me to solve this problem?

Label sms = new Label();
       sms.Text = "Your Login Id is " + user_id + " and password is " + pass;
       string strUrl = "http://www.way2sms.com?user=user_id:pass&senderID=e&receipientno=9001233211&msgtxt= " + sms  ;
       WebRequest request = HttpWebRequest.Create(strUrl);
       HttpWebResponse response = (HttpWebResponse)request.GetResponse();
       Stream s = (Stream)response.GetResponseStream();
       StreamReader readStream = new StreamReader(s);
       string dataString = readStream.ReadToEnd();
       response.Close();
       s.Close();
       readStream.Close();
       dbcon.closecon();
        try
       {
           //Create the request and send data to Ozeki NG SMS Gateway Server by HTTP connection
           HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(strUrl);
           //Get response from Ozeki NG SMS Gateway Server and read the answer
           HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
           System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
           string responseString = respStreamReader.ReadToEnd();
           respStreamReader.Close();
           myResp.Close();
           //inform the user
           //lblMessage.Visible = true;
           //lblMessage.Text = "Sent Successfully";
           //textboxError.Visible = true;
       }
       catch (Exception ex)
       {
           //if sending request or getting response is not successful, Ozeki NG - SMS Gateway Server may not be running
           //lblMessage.Visible = true;
           //lblMessage.Text = " SMS Gateway Server is not running!" + "<br/>" + createdURL + ex.Message;
           //textboxError.Visible = true;
       }

查看它并没有明显问题.
可能就是您的称呼方式.
Having looked over it there is no obvious problem.
It may be how you are calling it.