Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Maria Shah
  Where is Maria Shah?
 Peshawar
 Pakistan
 Maria Shah
 To: Rashid Mehmood
  Where is Rashid Mehmood?
 Sialkot
 Pakistan
 Rashid Mehmood
 Tags
Subject: RE: Sending SMS
Thread ID: 395672 Message ID: 395768 # Views: 44 # Ratings: 0
Version: Visual FoxPro 7 Category: Active X Controls & OLE Automation
Date: Saturday, January 18, 2014 6:36:37 PM         
   


> Hi Experts
>
> I am using EDGE GSM Modem for send SMS in Visual Foxpro 7 and using these code
>
>
> Close Databases
> oSMS=Createobject("MSCommLib.MSComm.1")
>
> Create Cursor curCellNos(name c(15),addess c(50),contact c(25))
> Insert Into curCellNos Values('Rashid','Mehmood','03216102031')
> lcMessage="Hello world!"
> Select curCellNos
> Scan
> SendSMS(Alltrim(contact),lcMessage)
> Endscan
> CLOSE ALL
>
> Procedure SendSMS
> Parameters pCellNo,pMessage
> With oSMS
> If .PortOpen
> .PortOpen = .F.
> Endif
> .CommPort = 14 && variable
> .Settings = "460800,N,8,1"
> .Handshaking = 3
> .RTSEnable = .T.
> .DTREnable = .T.
> .RThreshold = 1
> .SThreshold = 1
> .InputLen = 0
> .PortOpen = .T.
> If Vartype(oError)==[O]
> Messagebox("Check your connection/port setting.",16,"SMS Sender")
> Return .F.
> Endif
> Endwith
> oSMS.Output = "AT" +Chr(13)
> Delay(Datetime(),5000)
> oSMS.Output = "AT+CMGF=1" +Chr(13)
> Delay(Datetime(),5000)
> oSMS.Output = "AT+CMGS=" + Chr(34) + pCellNo + Chr(34)+Chr(13)
> Delay(Datetime(),5000)
> oSMS.Output = pMessage + Chr(26)
> Delay(Datetime(),5000)
> Endproc
>
>
> Procedure Delay
> Parameters pStart,pEnd
> Do While Datetime()-pStart=pEnd
> Do Events
> Enddo
> ENDFUNC
>
> its run no error but the message is not delivered, Please help me what i do for remove this problem.
>
> Thanks in advance
>
> Rashid Mehmood


Hello Rashid

i'm using nokia c101 and hspa gsm modem

check my code

thisform.comm1.PortOpen = .f.
SELECT sms
thisform.Comm1.CommPort = sms.portnumber
thisform.Comm1.Handshaking = 0
thisform.Comm1.RThreshold = 0
thisform.Comm1.RTSEnable = .f.
thisform.Comm1.Settings = sms.setting
thisform.Comm1.SThreshold = 0
thisform.Comm1.InputMode = 0
thisform.Comm1.PortOpen = .t.
thisform.comm1.output="ATE1"+chr(13)
thisform.comm1.inbuffercount=0
wait 'Wait . . .' window TIMEOUT 0.2
thisform.comm1.output='AT+CMGF=1'+chr(13)
wait 'Wait . . .' window TIMEOUT 0.2

cun=ALLTRIM(thisform.txtnumber.Value)
thisform.comm1.output='AT+CMGS="'+cun+'"'+chr(13)
wait 'Sending . . .' window TIMEOUT 0.2
thisform.comm1.output = ALLTRIM(sms.sender)+chr(10)+;
'REMARKS :'+CHR(10)+;
ALLTRIM(thisform.txtremarks1.Value)+CHR(10)+;
ALLTRIM(thisform.txtremarks2.Value)+CHR(10)+;
ALLTRIM(thisform.txtremarks3.Value)+CHR(10)+;
ALLTRIM(thisform.txtremarks4.Value)+CHR(10)+ CHR(26)



SoftTouch I.T Solutions
www.softtouchpk.weebly.com

ENTIRE THREAD

Sending SMS Posted by Rashid Mehmood @ 1/17/2014 4:31:25 PM
RE: Sending SMS Posted by Usman Safdar @ 1/17/2014 7:18:00 PM
RE: Sending SMS Posted by Rashid Mehmood @ 1/18/2014 3:55:06 PM
RE: Sending SMS Posted by Usman Safdar @ 1/18/2014 5:23:09 PM
RE: Sending SMS Posted by Maria Shah @ 1/18/2014 6:36:37 PM
RE: Sending SMS Posted by Rashid Mehmood @ 1/18/2014 6:58:51 PM