Showing posts with label sending sms. Show all posts
Showing posts with label sending sms. Show all posts

follow these step and you can send sms easily from your own developed portal

This code is woring fine

i had already made use of this.

First visit the website www.smsc11.com and ask for demo

then they will provide username and password for limited use only for  demo

then use this username and password in the api give below in front of uname and pwd

for e.g in API write username in front of uname and password in front of pass

?&uname=dem&pass=dem



sendsms.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SMSSEND.aspx.cs" Inherits="SMSSEND" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 502px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table class="style1">
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <div>
   
    </div>
    </form>
</body>
</html>


code required  for this \
sendsms.aspx.cs

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 SMSSEND : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string senderusername = "demo";

        string senderpassword = "Demo@567";

        string senderid = "DEMOAC";

      

        string sURL = "www.smsc11.com";

        string num;

        num = TextBox1.Text;

        StreamReader objReader;

        sURL = "http://smsc11.com/corp/extendingsms1.jsp?uname=&pass=&mobile="+ num +"&msg=hi&sender=DEMOAC" + TextBox2.Text;

        WebRequest wrGETURL;

        wrGETURL = WebRequest.Create(sURL);

        try
        {

            Stream objStream;

            objStream = wrGETURL.GetResponse().GetResponseStream();

            objReader = new StreamReader(objStream);
            objReader.Close();
        }

        catch (Exception ex)
        {

            ex.ToString();

        }
    }
}




IMportant link of sending sms

May 15, 2013 |

here is some valuable link for sending sms

after following these link i have added sending sms in my project and it is working fine


http://weblogs.asp.net/rajneesh-verma/archive/2011/10/17/sending-sms-through-asp-net-using-sms-sending-api-from-providers.aspx
http://www.rajneeshverma.com/post/2011/10/16/Sending-SMS-through-ASPNET-using-SMS-sending-API-from-providers.aspx
Rajneesh 




Whatever wife lectures the violent baffle. 

first of all i will let you know one thing
you need to buy an api for that or you can take a demo

this code is working fine in my project

  
   2:  
   3: protected void btnSendMessage_Click(object sender, EventArgs e)
   4:     {
   5:         string senderusername = "xxxxx";
   6:         string senderpassword = "xxxx";
   7:         string senderid = "xxx";        
   8:         string sURL;
   9:         StreamReader objReader;
  10:         sURL = "http://thundersms.com/smsapps/pushsms.php?username=" + senderusername + "&password=" + senderpassword + "&sender=" + senderid + "&mobile=91" + txtMobileNumber.Text + "&type=1&message=" + txtMessage.Text;
  11:         WebRequest wrGETURL;
  12:         wrGETURL = WebRequest.Create(sURL);
  13:         try
  14:         {
  15:             Stream objStream;
  16:             objStream = wrGETURL.GetResponse().GetResponseStream();
  17:             objReader = new StreamReader(objStream);
  18:             objReader.Close();
  19:         }
  20:         catch (Exception ex)
  21:         {
  22:             ex.ToString();
  23:         }
  24:     }
  25: