Need Help? Contact the Espiya Helpdesk. CLICK HERE


Author Topic: Send and Read SMS using VB.Net 2012 Code  (Read 1526 times)

killersmiles

  • Active - First Star
  • *
  • Posts: 10
  • Karma 9
Send and Read SMS using VB.Net 2012 Code
« on: February 10, 2015, 09:20:44 pm »
Pahelp naman po kung meron kayong code to send and read sms txt in tatoo gamit ay vb.net 2012.

Thanks po!!

siriusblack

  • Gold Member (Premium)
  • Active - Two Stars
  • *
  • Posts: 205
  • Karma 2
  • Gender: Male
  • God himself favors the brave.
Re: Send and Read SMS using VB.Net 2012 Code
« Reply #1 on: February 10, 2015, 11:17:24 pm »
Hi! used AT commands for sending text using huawei modem. Please see sample below.

Private Sub subSendMessage(ByVal strMobileNo As String, ByVal strMessage As String)
        rsPort.Open()

        With rsPort
            .ReceivedBytesThreshold = 1

            .DtrEnable = True

            .Write("AT" & vbCrLf)

            .Write("AT+CMGF=1" & vbCrLf) 'Modem Text Mode


            .Write("AT+CMGS=" & Chr(34) & strMobileNo & Chr(34) & vbCrLf)

            .Write(strMessage & Chr(26))

            .DtrEnable = False
        End With

        rsPort.Close()


    End Sub