Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
hi; here below are my codes whic i can send single SMS using GSM. but, i am unable to send bulk SMS. For bulk i am using dataGridciew control.

Single SMS code

C#
public void sendSinglesms()
       {

               sms = new SmsClass(cmbport.Text);
               sms.Opens();
               sms.sendSms(txttelephone.Text, "**MediAlert** ");
               sms.Closes();
               MessageBox.Show("Suucessfully Message Sent!");

       }



Bulk SMS code

C#
sms = new SmsClass(cmbport.Text);
           sms.Opens();
           foreach (DataGridViewRow row in dataGridViewpatientdetails.Rows)
           {
               DataGridViewCheckBoxCell CbxCell = (DataGridViewCheckBoxCell)row.Cells[0];
               if (Convert.ToBoolean(CbxCell.Value) == true)
               {
               //cell[2] is telephone number
                sms.sendSms(row.Cells[2].ToString(), "**MediAlert** ");
               }
           }
           sms.Closes();
           MessageBox.Show("Suucessfully Message Sent!");
}
Posted
Comments
[no name] 25-Aug-14 14:15pm    
You need to learn to use the debugger and be more informative than "I am unable". row.Cells[2].ToString(), should probably be row.Cells[2].Value.ToString(),
Sergey Alexandrovich Kryukov 25-Aug-14 14:24pm    
Bulk..? May I know the purpose?
—SA
zakirox123 25-Aug-14 14:38pm    
this for my medical alert project here i am getting another problem its just sending one message at a time :(

sms = new SmsClass(cmbport.Text);
sms.Opens();
foreach (DataGridViewRow row in dataGridViewpatientdetails.Rows)
{
DataGridViewCheckBoxCell CbxCell = (DataGridViewCheckBoxCell)row.Cells[0];
if (Convert.ToBoolean(CbxCell.Value) == true)
{
//cell[2] is telephone number
sms.sendSms(row.Cells[2].Value.ToString(), "**MediAlert**");
}
}
sms.Closes();
MessageBox.Show("Suucessfully Message Sent!");
}
zakirox123 25-Aug-14 16:18pm    
this for my medical alert project here i am getting another problem its just sending one message at a time :(

sms = new SmsClass(cmbport.Text);
sms.Opens();
foreach (DataGridViewRow row in dataGridViewpatientdetails.Rows)
{
DataGridViewCheckBoxCell CbxCell = (DataGridViewCheckBoxCell)row.Cells[0];
if (Convert.ToBoolean(CbxCell.Value) == true)
{
//cell[2] is telephone number
sms.sendSms(row.Cells[2].Value.ToString(), "**MediAlert**");
}
}
sms.Closes();
MessageBox.Show("Suucessfully Message Sent!");
}
Hemant L Patil 28-Aug-14 3:09am    
Are You Want To Send SMS from Your GSM Modem to other multiple number or Single Number ? using Your software Code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900