Click here to Skip to main content
15,892,005 members
Articles / Programming Languages / C#

Sending SMS using .NET through a Web service

Rate me:
Please Sign up or sign in to vote.
2.87/5 (87 votes)
7 Jun 20043 min read 1.1M   45.2K   178  
This article will help you to know how to use web services in .NET
<%@ Page language="c#" Codebehind="SendSms.aspx.cs" AutoEventWireup="false" Inherits="SmsTest.WebForm1" %>

<HTML>
  <HEAD>
		<title>Sending Text Messages with .NET</title>
</HEAD>
	<body>
		<h2>Sending Text Messages with .NET</h2>
		<form method="post" runat="server" ID="Form1">
			<table>
  <TR>
    <TD colSpan=2 height=22>&nbsp;
<asp:RadioButtonList id=rdoType runat="server" AutoPostBack="True" RepeatDirection="Horizontal" Width="304px">
<asp:ListItem Value="1" Selected="True">SMS to India</asp:ListItem>
<asp:ListItem Value="2">SMS to world</asp:ListItem>
</asp:RadioButtonList></TD></TR>
				<TR>
					<TD>Email Id</TD>
					<TD>
						<asp:TextBox id="txtEmailId" runat="server"></asp:TextBox>( ex 
						:&nbsp;test@test.com )</TD>
				</TR>
				<TR>
					<TD>Country Code</TD>
					<TD><asp:textbox id="txtCountryCode" runat="server" text=""></asp:textbox>&nbsp;(ex 
						: 91 for&nbsp;India</TD>
				</TR>
				<tr>
					<td>Mobile/cell Number</td>
					<td><asp:textbox id="txtMobileNo" runat="server" text=""></asp:textbox>&nbsp;( ex 
						:&nbsp;984xxxxxxxx&nbsp;)</td>
				</tr>
				<tr>
					<td>Message</td>
					<td><asp:textbox id="txtMessage" runat="server" rows="4" textmode="MultiLine"></asp:textbox></td>
				</tr>
				<tr>
					<td></td>
					<td align="right"><asp:Button id="Send" runat="server" Text="Send"></asp:Button></td>
				</tr>
			</table>
			<asp:Label id="lblMessage" runat="server" forecolor="Red" Visible="False"></asp:Label>
		</form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I have done Bachelor in Mechanical Engineering. I have strong background in C#, ASP.NET, SQL server 2000. And i also worked in some small application in Mobile.NET and CF.NET

Comments and Discussions