Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends/Experts,

I am trying a bulk sms send application using vb.net and windows 7, it sends one sms but not the others, but when I run the app step by step in debug mode it do send all smss, plz help, following is the potion of code used for send sms.

VB
Button3.Enabled = False
      Dim c As Integer
      c = DataGridView1.RowCount - 1
      Dim r As Integer = 0
      Dim pducodes() As String
      Dim pduL As Integer
      Dim pduStr As String
      Dim Number As String
      If smsEngine.IsOpen = False Then
          smsEngine.Open()
      End If
      PBar1.Minimum = r
      PBar1.Maximum = c
      smsEngine.Write("AT" & vbCrLf)
      txtR.SelectedText = smsEngine.ReadLine & vbCrLf
      smsEngine.DiscardInBuffer()

      smsEngine.Write("AT+CMGF=0" & vbCrLf)
      'txtR.SelectedText = smsEngine.ReadLine & vbCrLf
      smsEngine.DiscardInBuffer()
      Label1.Visible = True
      Do
          PBar1.Value = r + 1
          Label1.Text = "Sending Message: " & r + 1 & "/" & c
          Number = DataGridView1.Item(0, r).Value
          DataGridView1.Rows(r).Selected = True
          If RdEng.Checked Then
              pducodes = GetPDU("+923189244444", Number, ENUM_TP_DCS.DefaultAlphabet, ENUM_TP_VALID_PERIOD.OneDay, 0, False, TextBox1.Text)
          Else
              pducodes = GetPDU("+923189244444", Number, ENUM_TP_DCS.UCS2, ENUM_TP_VALID_PERIOD.OneDay, 0, False, TextBox1.Text)
          End If
          pduStr = pducodes(0)
          pduL = (pducodes(0).Length - 14) / 2 - 1
          Application.DoEvents()
          smsEngine.Write("AT+CMGS=" & pduL & vbCr)
          txtR.SelectedText = smsEngine.ReadLine & vbCrLf
          Thread.Sleep(100)
          smsEngine.DiscardInBuffer()
          '  Do
          smsEngine.Write(pduStr & Chr(26))
          txtR.SelectedText = smsEngine.ReadLine & vbCrLf
          Thread.Sleep(200)
          Application.DoEvents()
          ' Loop While (InStr(smsEngine.ReadLine, "OK"))
          smsEngine.DiscardInBuffer()
          DataGridView1.Rows(r).Selected = False
          r = r + 1
          ' Thread.Sleep(2000)
          DataGridView1.Update()

      Loop While r < c
      smsEngine.Close()
Posted
Comments
[no name] 29-Sep-14 2:25am    
Have you configured that in your third party tool ? You must configure that bulk sms feature there!. You can contact your third party tool support.

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