Search code examples
vb.netsmsat-command

How to send long message using AT Commands, vb.Net


        strMessage = SplitSMS(_dtMessageQueue.Rows(0)("Response"), 155)

        For i As Integer = 0 To strMessage.GetUpperBound(0)
            Try
                With SerialPort1
                    .Write("AT" & vbCrLf)
                    Threading.Thread.Sleep(2000)
                    .Write("AT+CMGF=1" & vbCrLf)
                    Threading.Thread.Sleep(2000)
                    .Write("AT+CMGS=" & Chr(34) & _dtMessageQueue.Rows(0)("MobileNo") & Chr(34) & vbCrLf)
                    .Write(strMessage(i) & Chr(26) & vbCrLf)
                    Threading.Thread.Sleep(3000)
                End With
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        Next

I have written the above code in order to send SMS from my vb.net application to a Mobile phone.

Is it possible to send the message without splitting message,

I want to send the message as one.


Solution

  • SMS length is limited to 160 seven-bit characters. It was subsequently codified into the SMPP signalling protocol that transmits SMS and is limited to precisely 140 bytes (or 1120 bits).

    try reading this