Jump to content

sending sms to mobile no..code not working

Recommended Posts

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sms.aspx.cs" Inherits="sms" %><!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></title></head><body>    <form id="form1" runat="server">  <div style="font-family: 'Times New Roman', Times, serif; font-size: medium; color: #FF3300; background-color: #0033CC"><div style="border: thick inset #FFFFFF; text-transform: capitalize; font-family: Arial; font-weight: bolder; font-size: large; color: #800000; background-color: #99CCFF; text-decoration: underline blink; text-align: center;">Sending of sms to mobile through asp.net<br/>		    </div> <br/>		    <br/>  <asp:panel id="Panel1" runat="server" width="475px">       <table>    <tbody><tr>   <td>    Mobile No. :   </td>   <td>    <asp:textbox id="TextBox1" runat="server"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="TextBox1" errormessage="Enter The Value" forecolor="#FF3300"></asp:requiredfieldvalidator>   </td> </tr><tr>    <td>	 Mobile Password :   </td>   <td>  <asp:textbox id="TextBox2" runat="server" textmode="Password"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" controltovalidate="TextBox2" errormessage="Enter The Value" forecolor="#FF3300"></asp:requiredfieldvalidator>   </td> </tr><tr> <td>		    To Mobile No :   </td>   <td>  <asp:textbox id="TextBox3" runat="server"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator3" runat="server" controltovalidate="TextBox3" errormessage="Enter The Value" forecolor="#FF3300"></asp:requiredfieldvalidator>   </td></tr><tr>  <td>	 Message :   </td>   <td> <asp:textbox id="TextBox4" runat="server" height="75px" textmode="MultiLine"></asp:textbox>	   <asp:requiredfieldvalidator id="RequiredFieldValidator4" runat="server" controltovalidate="TextBox4" errormessage="Enter The Value" forecolor="#FF3300"></asp:requiredfieldvalidator>   </td> </tr>       </tbody></table>    </asp:panel>    <iframe runat="server" style="visibility:hidden;" id="sms1"></iframe>	                                                           ÂÂ	    <asp:button id="Button1" runat="server" onclick="Button1_Click" text="Send Sms">		    </asp:button></div>    </form></body></html>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class sms : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {    }    protected void Button1_Click(object sender, EventArgs e)    {	    try	    {		    sms1.Attributes.Add("Src", "http://site5.way2sms.com/jsp/regcon.jsp?random=C250DEB289834CA172F7EFAC73503FC7.w8131364157894809" + TextBox1.Text + "&pwd=" + TextBox2.Text + "&msg=" + TextBox4.Text + "&phone=" + TextBox3.Text + "&provider=way2sms");		    Response.Write("mail sucessfully sent to '" + TextBox3.Text + "'!!!  kindly check ur phone ");		    Panel1.Visible = false;		    Button1.Visible = false;	    }	    catch (Exception ex) { Response.Write(ex.Message); }    }}

i found this code on google. this is not working. kindly tell me where is the problem. kindly see code.

Link to post
Share on other sites

What happens when you run it? What errors are you getting? Does that SMS provider require an account? That's not the actual code you're running, right? You have the code parts in the necessary files?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...