Hi!
Please how can I send my SMS throught Textboxs and combobox? I am asking this simple question because I must insert in that line of code in red the cellnumber(s). But I don't want that way. I need a professional way.
user = txtUser, password = txtPassword; api_id = txtApiId; cellphone= cbxCellnumber; message = txtMsg
string baseurl = "http://api.clickatell.com/http/sendmsg?user=[x]&password=[xx]&api_id=[xxx]&to=[xxxx]&text=Message" + to + "'&text='" + msg + "'";
private void button1_Click(object sender, EventArgs e)
{
try
{
WebClient client = new WebClient();
string to, msg;
to = textBoxTo.Text;
msg = textBoxMsg.Text;
string baseurl = "http://api.clickatell.com/http/sendmsg?user=[x]&password=[xx]&api_id=[xxx]&to=[xxxx]&text=Message" + to + "'&text='" + msg + "'"; // This line here
client.OpenRead(baseurl);
MessageBox.Show("Message sent");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
Loading
Jignesh TrivediPosted Sep 9, 2014, 4:49 AM
Yes of course.
this is just like passing message in your original question... :)
string baseurl = "http://api.clickatell.com/http/sendmsg?user=[x]&password=[xx]&api_id=[xxx]&to=" + cellphone + "&text=Message" + to + "'&text='" + msg + "'";
hope this will help you.
Mfwamba TshimangaPosted Sep 9, 2014, 4:42 AM
Jignesh TrivediPosted Sep 9, 2014, 12:00 AM
Hi,
I think, you can pass cell number in "TO" Query string....
example if your cell number is 8899445530 than you url become
string baseurl = "http://api.clickatell.com/http/sendmsg?user=[x]&password=[xx]&api_id=[xxx]&to=8899445530&text=Message" + to + "'&text='" + msg + "'";
also refer
https://www.clickatell.com/apis-scripts/scripts/c-scripts/
hope this will help you.