Sending SMS in VB 6

vb6 , sms , mscomm India
  • 12 years 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", , ""
  • 12 years ago
    Plz let me know when anybody replies, thanks
  • 12 years 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? :)
  • 12 years 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.
  • 12 years ago
    sir my problem is that SMS are not going in bulk, like more than one at a time. plz guie me
  • 12 years 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
  • 12 years 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
  • 11 years 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).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”