SMS Via Comport AT+ commands

I use Delphi and want to send SMS via the COM Ports + Mobile phone combination.
I am using the AT+ commands but I get SMS which includes the commands. I want only the message to come.
Sample SMS

AT+CMGF=1AT
AT
AT
AT+CMGF=1

AT
+CMGS="nnnnnnnnnnn"

Open in new window

Allan_FernandesAsked:
Who is Participating?
 
Allan_FernandesConnect With a Mentor Author Commented:
I tried Synapse and it worked fine
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
Please add some code...

What happens if you omit the AT commands, perhaps they are not used if you get these commands in the message string?
0
 
Allan_FernandesAuthor Commented:
This is the code. If I skip any line it does not work

// DFM has  object ComPort: TComPort


procedure Tform_Starter.Button8Click(Sender: TObject);
var
  n:Integer ;
begin
  ComPort.Port:='COM3' ;
  ComPort.BaudRate:=br9600 ;
  ComPort.Parity.Bits:=prNone  ;
  ComPort.DataBits:=dbEight ;
  ComPort.StopBits:=sbOneStopBit ;
  ComPort.Open ;
  if ComPort.Connected then
    memo_Text.lines.add('Connected')
  else
    memo_Text.lines.add('Not Connected') ;

  sleep(4000) ;

  sysSndStr:='AT+CMGF=1'+#13#10 ;
  n:=ComPort.WriteStr(sysSndStr) ;
  memo_Text.lines.add(IntToStr(n)) ;
  sleep(4000) ;


  sysSndStr:='AT+CMGS="9867015256"'+#13#10+'"HI"'+#26+#13#10 ;
  n:=ComPort.WriteStr(sysSndStr) ;
  memo_Text.lines.add(IntToStr(n)) ;

  sleep(4000) ;

  ComPort.Close  ;
end;

Open in new window

0
 
Allan_FernandesAuthor Commented:
of late Experts Exchange has never been able to provide me solutions. Quality has fallen badly
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.