mar. 26 novembre 2019, 01h00
kikoun
Côte d'Ivoire
atoutfox.public.association
Envoyer des SMS par foxpro
Bonjour à tous
Je dois envoyer des SMS automatique à des fournisseurs.
Mon soucis se trouve au niveau de l'envoi. Je me suis inspiré de la contribution de Mike GAGNON
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000458Il me marque que le message est parti mais je ne recois pas de message chez le destinataire.
Voici mes codes.
Dans Init du formulaire :
<VFP>
thisform.Comm1.CommPort = 3 &&"Le port qui communique au modem"
thisform.Comm1.Handshaking = 0
thisform.Comm1.RThreshold = 0
thisform.Comm1.RTSEnable = .f.
thisform.Comm1.Settings = "9600,n,8,1"
thisform.Comm1.SThreshold = 0
thisform.Comm1.InputMode = 0
thisform.comm1.portOpen = .T.
</VFP>
Dans l'evenement Click du bouton :
<VFP>
thisform.comm1.output="ATE1"+chr(13)
thisform.comm1.inbuffercount=0
wait 'Sending . . .' window TIMEOUT 0.2
thisform.comm1.output='AT+CMGF=1'+chr(13)
wait 'Sending . . .' window TIMEOUT 0.2
thisform.comm1.output='AT+CMGS="'+'0022502502258'+'"'+chr(13)
wait 'Sending . . .' window TIMEOUT 0.2
thisform.comm1.output=[message à envoyer]+chr(26)
wait 'Envoi . . .' window TIMEOUT 5
wait 'Message parti!' window
</VFP>
Mon appareil GSM Modem a le port COM3, avec la configuration 9600,n,8,1.
Cordialement.
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019491