日期:2014-05-16 浏览次数:20873 次
<?
$PHONE="15186997171,18786077320,15180862841";
$CONTENT="测试:test";
//-- 向手机号码发送 --
$wsdl="http://111.111.111.111:20/msgService/services/submitService?wsdl";//webservice接口地址
$username="111111";//用户名(sendsmsuser)
$password="12345";//密码(sendsmsuser)
$checkcode="6789"; //校验码
$sourceAddr="1061111111111"; //消息源地址
$serialnumber= (string)time(); //流水号
$sysid=$username;
$authCode=MD5($password.$checkcode);
$reqno=$serialnumber;
mb_substr ($CONTENT, 0, 200, $MYOA_CHARSET);
if($SEND_TIME=="")
$SEND_TIME=date("Y-m-d H:i:s",time());
$message = iconv("gb2312","utf-8",$CONTENT);
$MY_ARRAY=explode(",",$PHONE);
$ARRAY_COUNT=sizeof($MY_ARRAY);
$ERROR_CODE="";
for($I=0;$I< $ARRAY_COUNT;$I++)
{
if(trim($MY_ARRAY[$I])!="")
{
if(is_number($MY_ARRAY[$I]) || $MY_ARRAY[$I][0] == "+" && is_number(substr($MY_ARRAY[$I], 1)))
{
$PHONE_LIST=array();
$PHONE_LIST[count($PHONE_LIST)]=$MY_ARRAY[$I];
$message = iconv("gb2312","utf-8",$CONTENT);
$ReqHeader=array(
'authCode'=> $authCode,
'reqno'=> $reqno,
'sysid'=> $sysid
);
$SmsSubmit=array(
'content'=> $message,
'dest' => $PHONE_LIST,
'param' => null,
'sourceAddr' => $sourceAddr
);
$parameters=array(
'arg0'=> $ReqHeader,
'arg1'=> $SmsSubmit
);
$client = new SoapClient($wsdl);
try
{
$result=$client->__Call("smsSubmit",array('parameters'=> $parameters ));
}
catch(SoapFault $e){}
}
}
}
?>