如何提高短信发送成功率,我的代码发送4次丢一次
mobcomm.RThreshold = 1
mobcomm.CommPort = 1
mobcomm.InputLen = 0
mobcomm.PortOpen = True
Private Sub Command1_Click()
Sendsms "13800739500 ", phonecode.Text, msg.Text
End Sub
Public Function Sendsms(csca As String, num As String, msg As String) As Boolean
Dim pdu, psmsc, pnum, pmsg As String
Dim leng As String
Dim length As Integer
length = Len(msg)
length = 2 * length
leng = Hex(length)
If length < 16 Then leng = "0 " & leng
psmsc = Trim(telc(csca))
pnum = Trim(telc(num))
pmsg = Trim(ascg(msg))
pdu = prex & psmsc & midx & pnum & sufx & leng & pmsg
Sleep (100)
mobcomm.Output = "AT+CMGF=0 " + vbCr
Sleep (200)
mobcomm.Output = "AT+CMGS= " & Str(15 + length) + vbCr
Sleep (200)
mobcomm.Output = pdu & Chr$(26)
'Sleep (500)
Sendsms = True
MsgBox "ok "
End Function
[解决办法]
移动问题。。。为了防止乱发垃圾短信。
建议每次发送消息间隔时间拉大一点。具体多少,一次次尝试,得到经验值。
怎么提高短信发送成功率,小弟我的代码发送4次丢一次
如何提高短信发送成功率,我的代码发送4次丢一次mobcomm.RThreshold1mobcomm.CommPort1mobcomm.InputLen
