Saturday, 20 October 2012

send sms in asp.net c#


 public void sendsms()
    {
        string smsMessage = "with love" + "\r";
        smsMessage += "From" + "Sweeti" + "\r";
        smsMessage += "Subject:" + "Friendship" + "\r";
        smsMessage += "Message:" + "hi abhi , i love u ";

        string MobileNo = "9251950123";
        //HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        WebClient client = new WebClient();

   
        string baseurl = "http://sms.companyname.in/pushsms.php?username=Pinkcity Gold&password=264966&sender=Websms&to=" + MobileNo + "&message=" + smsMessage + "";
     


        Stream data = client.OpenRead(baseurl);
        StreamReader reader = new StreamReader(data);
        string s = reader.ReadToEnd();
        data.Close();
        reader.Close();
    }

No comments:

Post a Comment