|
-
May 27th, 2011, 02:31 AM
#1
Thread Starter
Addicted Member
[RESOLVED] SMS sending only working in Debug mode
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|