首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用clickatell网关发送多条消息

使用clickatell网关发送多条消息
EN

Stack Overflow用户
提问于 2013-08-14 15:54:23
回答 2查看 972关注 0票数 0

我使用php服务器端来连接clickatell消息服务,我使用soap api技术来建立连接。它在我的代码中工作.but,我可以在同一时间只发送一条消息,这是代码:

代码语言:javascript
运行
复制
    function actionSendSMS(){
       $msgModel = new Messages();
      $settModel = new Settings();

       $setRows = $settModel->findAll();
      $usr=$setRows[0]->clickatell_usr;
     $pwdRows = $settModel->findAll();
     $pwd=$pwdRows[0]->clickatell_pwd;


   $api_idRows = $settModel->findAll();

   $api_id=$api_idRows[0]->clickatell_api_id;







    $msgModel->findAllBySql("select * from messages where is_sent=0 and   
    send_date=".date("m/d/Y"));

      $client = new SoapClient("http://api.clickatell.com/soap/webservice.php?WSDL");
      $params = array('api_id' => $api_id,'user'=> $usr,'password'=> $pwd);
      $result = $client->auth($params['api_id'],$params['user'],$params['password']);
      $sessionID = substr($result,3);
      $callback=6;
     // echo $result."<br/>";
     // echo $sessionID;

      $params2 = array('session_id'=>$sessionID, 'api_id' => $api_id,'user'=> 
        $usr,'password'=>$pwd,
      'to'=>array('962xxxxxxx'), 'from'=>"thetester",'text'=>'this is a sample test  
           message','callback'=>$callback);
      $result2 = $client->sendmsg($params2['session_id'],  
           $params['api_id'],$params['user'],$params['password'],
      $params2['to'],$params2['from'],$params2['text'],$params2['callback']);
      print_r( $result2)."<br/>";




    $apimsgid=  substr($result2[0],4);

   $rowsx=Messages::model()->findAllBySql("select * from messages where is_sent=0 and  
     send_date='".date("m/d/Y")."'");



      for($i=0;$i<count($rowsx);$i++)
    {



      $rowsx[$i]->clickatell_id=$apimsgid;

     $rowsx[$i]->save();

       }


        //echo $apimsgid."<br/>";



          if (substr($result2[0], 0,3)==='ERR' && (!(substr($result2[0], 0,2)==='ID'  
          )  ))
      {
          echo 'Connot Routing Message';


      }

……现在你看到这个代码会同时发送一条消息,忘记id,它是为了个人目的,现在这个服务我必须修改它,同时发送多条消息,我会给每条消息一个唯一的ID,所以现在我的问题是:有没有人知道有没有一个同时发送多条短信的服务;

因为在我的代码中,我填写了一条消息的信息,但我需要一个服务来发送多条短信,有没有人可以给我一个链接到这个服务,我做了很多次搜索,但没有找到答案

EN

回答 2

Stack Overflow用户

发布于 2013-08-15 19:38:07

你试过了吗?

代码语言:javascript
运行
复制
$params2 = array('session_id'=>$sessionID, 'api_id' => $api_id,'user'=>        $usr,'password'=>$pwd, 'to'=>array('962xxxxxxx', '962xxxxxxx', '962xxxxxxx'), 'from'=>"thetester",'text'=...

代码语言:javascript
运行
复制
$params2 = array('session_id'=>$sessionID, 'api_id' => $api_id,'user'=>        $usr,'password'=>$pwd, 'to'=>array('962xxxxxxx,962xxxxxxx,962xxxxxxx'), 'from'=>"thetester",'text'=...
票数 0
EN

Stack Overflow用户

发布于 2014-04-01 18:15:35

尝试startbatch命令同时发送多条消息(也支持个性化)。但是,它不是基于soap的,而是基于http api的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18226079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档