hello. i have a small application that is meant to send out smses using AT commands in Vb .net.
the code seems to be working fine when i am debugging but when i run the normal way no sms is send. the following is my code, please help me see where i am going wrong.

dim smsPort As New SerialPort

smsPort.PortName = "COM18"
smsPort.BaudRate = "921600"
smsPort.Parity = Parity.None
smsPort.DataBits = 8
smsPort.StopBits = StopBits.One
smsPort.Handshake = Handshake.RequestToSend
smsPort.DtrEnable = True
smsPort.RtsEnable = True
smsPort.NewLine = vbCrLf

If Not (smsPort.IsOpen = True) Then
smsPort.Open()
End If

smsPort.WriteLine("AT" & vbCrLf)
smsPort.WriteLine("AT+CMGF=1" & vbCrLf)
smsPort.WriteLine("AT+CMGS=" + Chr(34) + Trim(TextBoxMobileNumber.Text) + Chr(34) + vbCrLf)
smsPort.WriteLine(Trim(TextBoxMessage.Text) + vbCrLf + Chr(26))


If smsPort.IsOpen = True Then
smsPort.Close()
End If