Try With SerialPort1 .PortName = ComboBox1.Text .BaudRate = 9600 .Parity = Parity.None .StopBits = StopBits.One .DataBits = 8 .Handshake = Handshake.RequestToSend .DtrEnable = True .RtsEnable = True .NewLine = vbCrLf .Open() txtbox.text=("Connected") End With Catch ex As Exception MsgBox(ex.Message) End Try
Try If SerialPort1.IsOpen Then With SerialPort1 .Write("AT" & vbCrLf) .Write("AT+CMGF=1" & vbCrLf) .Write("AT+CMGS=" & Chr(34) & TextBox1.Text & Chr(34) & vbCrLf) .Write(RichTextBox1.Text & Chr(26)) MsgBox("sms Sent") End With Else txtbox.text=("ERROR MSG ON PORT") End If Catch ex As Exception MsgBox(ex.Message) End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)