Hi there,
Why do you close the connection every time through your loop then reopen it for the next message! That is insane! You should open the connection then send all your messages then close the connection - move the sm.Opens() and sm.Closes() outside the loop and remove the Sleep(). E.g.
private void btnSendGrouped_Click(object sender, EventArgs e)
{
SmsClass sm = new SmsClass(cboPorts.Text);
sm.Opens();
for (int a = 0; a <= MobileNumbers.Items.Count - 1; a++)
{
sm.sendSms(MobileNumbers.Items[a].ToString(), GtxtMessage.Text);
}
sm.Closes();
MessageBox.Show("Messages Sent Successfully");
sm = null;
}
Hope this helps,
Ed