房产怎么利用Delphi发送销售短信

现在的房价价格并不是很稳定,因此在房价下降时,很多人都想出手买房。而开发商也想趁这个机会好好宣传自己的楼盘,所以,群发短信便成为了一个很好宣传手段,成本低,覆盖率高的特性,让群发短信在开发商之间广受好评。针对一些客户来说,通过群发短信可以实时知道自己倾向的楼盘的价格,在好的时机出手。

房产怎么利用Delphi发送销售短信_第1张图片

支持免费对接试用:乐讯通PaaS平台 找好用的短信平台,选择乐讯通,短信群发|短信平台|群发短信软件|群发短信平台|乐讯通PaaS平台icon-default.png?t=O83Ahttp://yun.loktong.com/login/register/0c61bafb77 

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdHTTP, IdURI, Httpapp;
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    function httpPost(postUrl:String;Params:TStrings):string;
  end;

var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
  url : string;
  username : string;
  password,apikey,mobile,content,encode,str : string;
  Params:   TStrings;
  i :Integer;
begin

  Params   :=   TStringList.Create;
  username := '登录账号'; //用户名
  password := 'E10ADC3949BA59ABBE56E057F20F883E'; //32位MD5密码加密
  token :='0d2b920f';//登录平台->首页获取TOKEN
  templateid :='8E76DC8A'; //登录平台-》模版管理
  param := '13700000001|1234'; //发送内容|参数值
  dstime:='';//定时时间不定时留空即可
  rece:='xml';//默认不填返回json就行
  timestamp:='1596179943000';//当前时间时间戳每次请求为动态获取保留13位到毫秒
  sign:='3BB634B21BCDFA4A5BDFBEF1BA9E9474';//md5(action=sendtemplate&username=登录账号&password=E10ADC3949BA59ABBE56E057F20F883E&token=0d2b920f×tamp=1596179943000)

  params.Add('action=sendtemplate');  //固定写死
  Params.Add('username='+username) ;  //用户名
  Params.Add('password='+password) ;  //密码
  Params.Add('token='+token) ;  
  Params.Add('templateid='+templateid) ;  
  Params.Add('param='+param) ;  
  Params.Add('dstime='+dstime) ;
  Params.Add('rece='+rece) ;
  Params.Add('timestamp='+timestamp) ;
  Params.Add('sign='+sign) ;

  url := 'http://www.lokapi.cn/smsUTF8.aspx'; //如连接超时,可能是您服务器不支持域名解析,请联系客服 
  resultxml=httpPost(url,Params);  //发送并把结果赋给result,返回一个XML信息,解析xml 信息判断
  Params.Free;
end;
function  TForm1.httpPost(postUrl:string;Params:TStrings):string;
var
  idhtp1: TIdHTTP;
begin
  idhtp1:=   TidHTTp.create(self);
  idhtp1.AllowCookies:=True;
  idhtp1.HTTPOptions:=[hoForceEncodeParams];
  idhtp1.ProtocolVersion:=pv1_1;
  idhtp1.Request.ContentType:='application/x-www-form-urlencoded';
  idhtp1.Request.CacheControl:='no-cache';
  idhtp1.Request.UserAgent:='User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1';
  idhtp1.Request.Accept:='Accept=textml,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
  idhtp1.Request.AcceptEncoding:='Accept-Encoding=gzip,deflate';
  idhtp1.Request.AcceptCharSet:='Accept-Charset=gb2312,utf-8;q=0.7,*;q=0.7';
  idhtp1.Request.Connection:='Connection=keep-alive';
  try
    result := idhtp1.Post(postUrl,Params);
  except
    Result := 'error';
end;
end;

end.

你可能感兴趣的:(php,开发语言,java,json)