send sms from asp.net to mobile

Posted by mareesnectar-12158 under ASP.NET on 11/11/2011 | Points: 10 | Views : 2394 | Status : [Member] | Replies : 1
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.Net;
using System.IO;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
string mobileno=TextBox1.Text;
string msg=TextBox2.Text;



///SMS GATEWAY PROVIDER PATH
string url = string.Format("http://XXXXProvider.com.com?phoneNumber={0}&MsgTxt={1}", mobileno, msg);

string url1 = String.Format(url, mobileno, msg);

//create Web Request object for the url
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url1);

// get the response from the web request
HttpWebResponse res = (HttpWebResponse)req.GetResponse();

// read the response from the WebResponse in to a stram
Stream s = res.GetResponseStream();
StreamReader rdr = new StreamReader(s);
string result = rdr.ReadLine();
s.Flush();
s.Close();
}
}

The above code run successfully....... but sms didnt sent to mobile.....
Give me the correct solution......
Thanks advance...
Regards,
M.Mareeswaran




Responses

Posted by: perfectchourasia-9163 on: 11/14/2011 [Member] Starter | Points: 25

Up
0
Down
www.ozekisms.com
read the url i have once created the functionality for my project just go through it .

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

mareesnectar-12158, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response