Pages

Monday, 2 January 2012

Sending SMS through asp.net

private void Send_Click(object sender, System.EventArgs e)
        {
            try
            {
                SmsTest.net.webservicex.www.SendSMS smsIndia =
                      new SmsTest.net.webservicex.www.SendSMS();
                SmsTest.com.webservicex.www.SendSMSWorld smsWorld =
                 new SmsTest.com.webservicex.www.SendSMSWorld();
                if (rdoType.SelectedValue == "1")
                    smsIndia.SendSMSToIndia(txtMobileNo.Text.Trim(),
                            txtEmailId.Text.Trim(), txtMessage.Text);
                else
                    smsWorld.sendSMS(txtEmailId.Text.Trim(),
                            txtCountryCode.Text.Trim(),
                            txtMobileNo.Text.Trim(), txtMessage.Text);
                lblMessage.Visible = true;
                lblMessage.Text = "Message Send Succesfully";
            }
            catch (Exception ex)
            {
                lblMessage.Visible = true;
                lblMessage.Text = "Error in Sending message" + ex.ToString();
            }
        }

        private void rdoType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (rdoType.SelectedValue == "1")
                txtCountryCode.Enabled = false;
            else
                txtCountryCode.Enabled = false;
        }

2 comments:

  1. Very nice, its very useful


    We can also submit our .net related article link on http://www.dotnettechy.com to increase the website traffic

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete