In my web applicatin i am using api for sending sms, ya it is working fine for single phone number, but my requirement is i want to send sms to two phone numbers(mobile numbers)can u help me.when user come to my site and register autometically admin will get sms alert, now i want to send sms at the same time.
protected void btnSend_Click(object sender, EventArgs e)
{
try
{
mobile =Server.HtmlEncode ( txtMobile.Text);
message = Server.HtmlEncode(txtMessage.Text);
username = Server.HtmlEncode(txtName.Text);
password = Server.HtmlEncode(txtPassword.Text);
domian = Server.HtmlEncode(txtDomain.Text);
string result = apicall("http://"+domian+"/pushsms.php?username="+username+"&password="+password+"&sender=&to="+mobile+"&message="+message);
if (!result.StartsWith("Wrong Username or Password"))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "alert('Message Sent')", true);
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "alert('Message Sending Failed')", true);
}
sentMail()
}
catch
{
}
}
public void sentMail()
{
string mobile = “9701098107”;
string message = “test”;
string username = “xxx”;
string password = “yyyy”;
string domian = “smsftt.com”;
string result1 = apicall(“http://” + domian + “/pushsms.php?username=” + username + “&password=” + password + “&sender=&to=” + mobile + “&message=” + message);
}
public string apicall(string url)
{
HttpWebRequest httpreq = (HttpWebRequest)WebRequest.Create(url);
try
{
HttpWebResponse httpres = (HttpWebResponse)httpreq.GetResponse();
StreamReader sr = new StreamReader(httpres.GetResponseStream());
string results = sr.ReadToEnd();
sr.Close();
return results;
}
catch
{
return "0";
}
}
Is this not just as simple as making that apicall again with different details? Change the mobile number you pass in and job done…