procedure TForm1.Button1Click(Sender: TObject);
begin
  ApdTapiDevice1.SelectDevice;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
  if ApdComPort1.ComNumber = 0 then
     ApdTapiDevice1.SelectDevice;
  ApdComPort1.Open := True;
  ApdGSMPhone1.SMSAddress := Edit1.Text;
  ApdGSMPhone1.SMSCenter := Edit2.Text;
  ApdGSMPhone1.SMSMessage := Edit3.Text;
  try
    ApdGSMPhone1.SendMessage;
    ShowMessage('成功');
  except
    ShowMessage('失败');
  end;
  ApdComPort1.Open := false;
end;
 
程序运行后 选择设备 不管是Motorola sm56 data fax modem 还是direct to com3 都提示发送失败?求助

解决方案 »

  1.   

    不知道你是否使用GSM模块,如果使用了,应该有AT指令集,通过AT指令完成短信的发送
      

  2.   

    从你的问题中看,你应该是使用了GSM模块进行发送。那么在发送之前要先确定与COM口通信的参数。如波特率,COM端口号,接入短消息中心号码都是必须要有的。另外发送的字符串需要处理非法字符,长度控制。还有你上面这句ApdComPort1.Open := True; 
    感觉一定有问题,这种代码完全不符合Delphi的规范。
      

  3.   

    发个demo给你 不用那么麻烦