我想从电脑向手机发送长短信(超过 160 个字符)。我在 VB6 中使用 MSComm 控件。它适用于小消息,但当我的消息超过 160 个字符时,它显示发送正常但消息未传递。
With MSComm1
.CommPort = port
.Settings = "9600,N,8,1"
.Handshaking = comRTS
.RTSEnable = True
.DTREnable = True
.RThreshold = 1
.SThreshold = 1
.InputMode = comInputModeText
.InputLen = 0
.PortOpen = True 'must be the last
End With
'Send an 'AT' command to the phone
MSComm1.Output = "AT" & vbCrLf
Sleep 500
MSComm1.Output = "AT+CMGF=1" & vbCrLf 'This line can be removed if your modem will always be in Text Mode...
Sleep 500
MSComm1.Output = "AT+CMGS=" & Chr(34) & mnumber & Chr(34) & vbCrLf 'Replace this with your mobile Phone's No.
Sleep 1000
MSComm1.Output = TxtMessage.Text & Chr(26)