教育行业怎么利用Delphi接口发送招生短信

在教育行业中,招生工作一直是学校、培训机构等教育机构的重要任务之一。随着科技的发展和市场的变化,利用短信平台发送招生短信已成为一种高速、便捷的招生手段。本文将探讨教育行业如何利用Delphi接口发送招生短信,以提高招生效率。

支持免费试用乐讯通PaaS平台 找好用的短信平台,选择乐讯通,短信群发|短信平台|群发短信软件|群发短信平台|乐讯通PaaS平台icon-default.png?t=N7T8http://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&timestamp=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.

 

  • 18
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值