1

Good day ma'am / sir

I'am using gsm modem D-LINK DWM - 156 for sending sms in vb 6.0 but it does'nt work. please help me. here is my code

Private Sub cmdSend_Click()
On Error Resume Next
    With objcom
        .CommPort = txtPort.Text
        .Settings = "9600,N,8,1"
        .RTSEnable = False
        .DTREnable = False
        .RThreshold = 1
        .SThreshold = 0
        .PortOpen = True
        .Output = "AT" & vbCrLf
        .Output = "AT+CMGF=1" & vbCrLf
        .Output = "AT+CMGS=" & Chr(34) & Trim(txtNumber) & Chr(34) & vbCrLf
        .Output = Trim(txtMsg) & Chr(26)
        Sleep 5000
        .PortOpen = True
    End With
MsgBox ("Message Sent!")
End Sub

thanks in advance.

Soonts
  • 20,079
  • 9
  • 57
  • 130
  • 1
    Based on comments there https://stackoverflow.com/a/28319758/126995 that particular modem doesn’t support sending SMS in text mode particularly well. The workaround is sending them in binary mode. Here’s a library for that, compatible with VB6 (it's an ActiveX component) but relatively expensive to license: https://www.activexperts.com/sms-component/ – Soonts May 08 '18 at 14:35
  • thanks a lot sir. what model of gsm modem can i use for sending sms? – Paul Santiago May 08 '18 at 14:50
  • 2
    Your modem probably works fine. Try using the “Encoding SMS messages for PDU mode” example to construct binary messages: http://www.scampers.org/steve/sms/samples.htm#pdu – Soonts May 08 '18 at 15:00
  • thank you sir. it means a lot – Paul Santiago May 08 '18 at 23:35
  • Your question says "it doesn't work" - can you please add some detail to explain that? – StayOnTarget May 09 '18 at 11:36
  • Sending sms not working sir – Paul Santiago May 11 '18 at 08:51

0 Answers0