Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how can i integrate sms gateway with asp.net application. I have user id and password for sms gaeteway.....but i am not getting how can i implemented it (link for wsdl file: http://api.fastalerts.in/webservice/falertservicerevised.php?wsdl[^]). pl'z provide me proper guideline for this.

Thanx
Posted
Updated 6-Nov-12 2:43am
v2
Comments
Ankur\m/ 6-Nov-12 8:58am    
Start with a simple Google search... say 'send sms asp.net'. You will certainly find what you are looking for.

C#
protected void sndmsg_Click(object sender, EventArgs e)
    {
        //code for sending message

        string str = numbers.Text;//number to send message
      

            if (numbers.Text == "")
            {
                numbers.Text += "Recipient(s) field must not be empty!\n";
                return;
            }
            //we creating the necessary URL string:
            string ozSURL = "http://127.0.0.1"; //where Ozeki NG SMS Gateway is running
            string ozSPort = "9501"; //port number where Ozeki NG SMS Gateway is listening
            string ozUser = HttpUtility.UrlEncode("admin"); //username for successful login
            string ozPassw = HttpUtility.UrlEncode("******"); //user's password
            string ozMessageType = "SMS:TEXT"; //type of message
            string ozRecipients = HttpUtility.UrlEncode(str); //who will get the message
            string ozMessageData = HttpUtility.UrlEncode(msgbox.Text); //body of message
            string createdURL = ozSURL + ":" + ozSPort + "/httpapi" +
                "?action=sendMessage" +
                "&username=" + ozUser +
                "&password=" + ozPassw +
                "&messageType=" + ozMessageType +
                "&recipient=" + ozRecipients +
                "&messageData=" + ozMessageData;

            try
            {
                //Create the request and send data to Ozeki NG SMS Gateway Server by HTTP connection
                HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(createdURL);

                //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
                textbox.Text = responseString;
                // textboxError.Visible = true;
            }
            catch (Exception)
            {
                //if sending request or getting response is not successful Ozeki NG SMS Gateway Server may do not run
                textbox.Text = "Ozeki NG SMS Gateway Server is not running!";
                textbox.Visible = true;
            }
        }

    

        //code end for sending message
    }
 
Share this answer
 
v2
Comments
Ankur\m/ 6-Nov-12 8:57am    
This is a code dump. How does it help OP? You haven't mentioned what Gateway you have used, the configuration required and a lot more details.
Aishwerya 6-Nov-12 9:03am    
I have used Ozeki NG Gateway server. It will be very generous of you if you please specify what it is you need help with. What's the point of confusion? About which configuration you are asking ?
Sumit_Kumar_Sinha 7-Nov-12 0:42am    
I crated a web form for sedning sms with all required field.....but i have confusion, how can i send below url afer clicking on Send button.
http://api.fastalerts.in/fastclient/SMSclient.php?username=senderusername&password=senderpwd&message=msg&numbers=phonenumber&senderid=senderid
Ankur\m/ 7-Nov-12 1:04am    
I am not the question poster. I am someone like you who likes to help. :)
Well the answer that you have posted doesn't make much sense. You have just copy pasted a code from some of your project. Read it from someone else perspective. If I paste this code in my application, will my application start sending SMS? I am sure not!
The question here asks for a help with implementing sms gateway. You could have started by suggesting few gateways and then probably explain a more about what you have used and why you choose that particular one and references to it. And if you don't want to go into such details, just give some links which talk about this topic.
The question is bad too. The OP has shown no efforts. He should have at least Googled and should have some basic analysis. For ex I know of an open source gateway which is well described in one of the CP articles. This is another very good article here which doesn't even use any Gateway. I have used it and it's works like a charm (of course with a few limitations).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900