Monday 17 February 2014

send SMS in asp.net

--> if you want to send sms using asp.net with c# code then do following
--> SMS service is not free , You must be purchase a SMS service pack from another company for send SMS

Other Articles - Step by step solution

------------------------------------------------------------------------
three tier architecture in asp.net
how to connect MS access in asp.net
how to access website in LAN
------------------------------------------------------------------------


--> Copy the following method in your code behind file


using System.Net;
using System.IO;


public void Send_SMS()
    {
        string username, Password, sender, to, message;
        //this all string variable contains Mobile No,Message
        WebClient client = new WebClient();
        string msg = "Thank you for visit Problemaspdotnet.blogspot.in blogs";
 string baseurl = " Your SMS provider link which Contains your   username,Password,sender,to,message....";
        WebRequest wrGETURL;
        StreamReader objReader;
        wrGETURL = WebRequest.Create(baseurl);
        try
        {
            Stream objStream;
            objStream = wrGETURL.GetResponse().GetResponseStream();
            objReader = new StreamReader(objStream);
            objReader.Close();
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
    }

--> and above function use on click event or any where ,
      where you want to send SMS

No comments:

Post a Comment



Asp.net tutorials