Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="Default9" %>


     <%@ Import Namespace='System.Text' %>
     <%@ Import Namespace='System.IO' %>
     <%@ Import Namespace='System.Net' %>
     <%@ Import Namespace='System.Web' %>
      <%@ Import Namespace='System.Web.UI' %>
      <%@ Import Namespace='System.Web.Services' %>
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

       <script runat="server">


      public void SendSMS()
      {
         UriBuilder urlBuilder = new UriBuilder();
        urlBuilder.Host = "127.0.0.1";
        urlBuilder.Port = 8800;

        string PhoneNumber = "+9154672585784";
        string message = "Just a simple text";

        urlBuilder.Query = string.Format("PhoneNumber=%2B" + PhoneNumber + "&Text=" + message);

        HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(new Uri(urlBuilder.ToString(), false));
        HttpWebResponse httpResponse = (HttpWebResponse)(httpReq.GetResponse());
     }



       protected void Page_Load(object sender, EventArgs e)
    {
        SendSMS();
    }

     </script>

     <html xmlns="http://www.w3.org/1999/xhtml">
     <head id="Head1" runat="server">
       <title>Send SMS</title>
     </head>
     <body>
     <form id="form1" runat="server">
     <div>
     </div>
     </form>
     </body>
     </html>



it shows an exception..unable to connect the remote server...so what i do..please help me....
Posted
Updated 3-Oct-13 21:05pm
v4

1 solution

I Have not Provided the UserName And sender ID b'coz u have to purchase sms from sms Seller then u will get this thing and authorized number is the number to get report of sms send

take all the mobile no u want to send sms in datatable as dt

C#
for(int i=0;i<dt.rows.count;i++)>
{
string url1 = "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=User_Name&senderID=ID SMS&receipientno=" + dt.Rows[i][0].ToString() + "&msgtxt='"+TextBoxName.Text+"' API&state=4";
 
               
                WebRequest request = HttpWebRequest.Create(url1);
                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();
}




this works in my asp.net with c# web application hope ur query is solve
 
Share this answer
 
v2

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