Community discussion forum

Sending SMS in VB 6

Tags: mscomm, sms, vb6 India
  • 1 year ago
    MSComm1.CommPort = 3 MSComm1.Settings = "9600,N,8 ,1" For j = 1 To 2 ' THIS IS NOT WORKING MSComm1.InputLen = 0 MSComm1.PortOpen = True MSComm1.Output = "AT" & Chr$(13) MSComm1.Output = "AT+CMGF=1" & Chr$(13) MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & Chr$(13) & Chr(10) MSComm1.Output = j & " " & txtMesg.Text & Chr$(26) MSComm1.PortOpen = False Next MsgBox "Sms Send", , ""
    Post was edited on 20/10/2008 17:30:14 Report abuse
  • 1 year ago
    Plz let me know when anybody replies, thanks
  • 1 year ago
    Hi there! Welcome to developerFusion. You haven't really said what the problem is, so you're unlikely to get an answer at the moment? :)
  • 1 year ago
    I notice that you have & Chr$(13) & Chr(10). I'm not sure about your version, (I use Visual Studio Express), but you may want to replace them with vbCr or vbCrLf. I have SMS working. You may want to try your commands in Hyperterminal first to make sure your code will work.
  • 1 year ago
    sir my problem is that SMS are not going in bulk, like more than one at a time. plz guie me
  • 1 year ago
    If MSComm1.PortOpen Then MSComm1.PortOpen = False End If For j = 1 To 2 ' SMS are going one by one, bUT IF I PUT A LOOP, THEN THEY ARE NOT GOING CONTINOUSLY With MSComm1 .CommPort = 3 .Handshaking = comNone .Settings = "57600,N,8,1" .InputLen = 0 .InBufferSize = 1024 .InputMode = comInputModeText .OutBufferSize = 512 .InBufferCount = 0 .RThreshold = 1 .SThreshold = 1 .PortOpen = True End With MSComm1.Output = "AT" & Chr$(13) & Chr(10) MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10) MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & ",129" & Chr$(13) & Chr(10) 'MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & Chr$(13) & Chr(10) MSComm1.Output = "No. " & j & Chr$(26) MSComm1.Output = "AT+CNMI=1,2,0,0,0 " & Chr$(13) Do DoEvents ' Buffer$ = Buffer$ & MSComm1.Input Loop Until MSComm1.InBufferCount > 2 MSComm1.PortOpen = False Next j
  • 1 year ago
    It looks like you open and close the port each time the loop cycles. Can you leave the port open and keep sending messages? I have a function that does that. I can share more if you need. will this work? ----> With MSComm1 .CommPort = 3 .Handshaking = comNone .Settings = "57600,N,8,1" .InputLen = 0 .InBufferSize = 1024 .InputMode = comInputModeText .OutBufferSize = 512 .InBufferCount = 0 .RThreshold = 1 .SThreshold = 1 .PortOpen = True End With For j = 1 To 2 ' SMS are going one by one, bUT IF I PUT A LOOP, THEN THEY ARE NOT GOING CONTINOUSLY MSComm1.Output = "AT" & Chr$(13) & Chr(10) MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10) MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & ",129" & Chr$(13) & Chr(10) 'MSComm1.Output = "AT+CMGS= " & Chr(34) & txtRecpMobileNo.Text & Chr(34) & Chr$(13) & Chr(10) MSComm1.Output = "No. " & j & Chr$(26) MSComm1.Output = "AT+CNMI=1,2,0,0,0 " & Chr$(13) Do DoEvents ' Buffer$ = Buffer$ & MSComm1.Input Loop Until MSComm1.InBufferCount > 2 Next j MSComm1.PortOpen = False
  • 1 month ago

    any sample vb6 program for sending and receiving sms just want to learn how to do it in vb6. what i need to know? thanks

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!