Hi guys,I'm trying to send sms using asp.net c#.
just a small background - its about sending members a message when they sign up,
but i am stuck with sending message ,
protected void sendmessagetomobile()
{
try
{
string uid = "9999999999";
string password = "****";
string message = "Test";
string no = "9999999999";
//string no = TextBox1.Text;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=way2sms");
HttpWebResponse myResp = (HttpWebResponse)req.GetResponse();
StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
string responseString = respStreamReader.ReadToEnd();
respStreamReader.Close();
myResp.Close();
Response.Write("sent");
}
catch (WebException ee) { }
}
I'm kinda still new to this programming,so any kind of help will be greatly helpful..
Amit ShrivastavaPosted Feb 11, 2015, 5:03 AM
{
using (var wb = new WebClient())
{
byte[] response = wb.UploadValues("https://URL", new NameValueCollection()
{
{"username" , username},
{"hash" , HashKey},
{"numbers" , txtMobileNo.Text},
{"message" , txtMessage.Text},
{"sender" , txtFrom.Text}, // not more than 11 charactor
{"test" , "true"}// for testing purpose
});
string result = System.Text.Encoding.UTF8.GetString(response);
return result;
}
}
Riddhi ValechaPosted Feb 11, 2015, 1:24 AM
For sending messages on mobile from ASP.NET Portal, can we do it without using a 3rd party dll ??
Karthik JPosted Feb 10, 2015, 10:01 PM
Francis SusaimichaelPosted Feb 10, 2015, 9:36 PM