can anyone help me to make code below send long SMS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sub SendSMS()
If Modem.IsOpen = False Then
MsgBox("Port not Open!!")
Exit Sub
End If
If Me.TxtTo.Text = "" Then
MsgBox("No recepient number!!")
Exit Sub
End If
If Me.TxtSMS.Text = "" Then
MsgBox("Blank text message are not allowed!!")
Exit Sub
End If
sendbutton.Enabled = False
Sending = True
SendAttempt = 0
Do
ATSend("AT+CMGF=1")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
Do
ATSend("AT+CSMP=17,167,0,0")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
Do
Do
ATSend("AT+CMGS=""" & TxtTo.Text & """")
Result = ATRead(1000)
Loop While Result.Contains("COMMAND NOT SUPPORT")
ATSend(TxtSMS.Text & Char.ConvertFromUtf32(26) & vbCr)
'ATSend(MyMessage & Char.ConvertFromUtf32(26) & vbCr)
'ATSend(MyMessage & vbCrLf & Chr(26))
Result = ATRead(10000)
SendAttempt += 1
Loop While Result.Contains("COMMAND NOT SUPPORT") Or (Result.Contains("ERROR") And SendAttempt < 5)
If Result.EndsWith(vbCrLf & "OK" & vbCrLf) Then
TxtSMS.Text = ""
TxtTo.Text = ""
' MsgBox("Message Successfully Sent")
Else
' MsgBox("Message Could Not Be Sent", MsgBoxStyle.Critical, "Error")
End If
sendbutton.Enabled = True
Sending = False
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
please help.
Nov 15 2014, 03:22 PM, updated 12y ago
Quote
0.0141sec
0.54
5 queries
GZIP Disabled