首先需要确保服务器网络环境可以连接到短信发送服务器,可以ping域名sms.destoon.com测试,并且PHP环境需要支持curl函数,具体可以查看phpinfo,如下图:
V6.0版本更新到最新更新即可解决,如果暂不更新,可以修改include/global.func.php里的send_sms函数为:
V6.0版本更新到最新更新即可解决,如果暂不更新,可以修改include/global.func.php里的send_sms函数为:
- function send_sms($mobile, $message, $word = 0, $time = 0) {
- global $db, $DT, $DT_TIME, $DT_IP, $_username;
- if(!$DT['sms'] || !DT_CLOUD_UID || !DT_CLOUD_KEY || !is_mobile($mobile) || strlen($message) < 5) return false;
- $word or $word = word_count($message);
- $sms_message = convert($message, DT_CHARSET, 'UTF-8');
- $data = 'sms_uid='.DT_CLOUD_UID.'&sms_key='.md5(DT_CLOUD_KEY.'|'.$mobile.'|'.md5($sms_message)).'&sms_charset='.DT_CHARSET.'&sms_mobile='.$mobile.'&sms_message='.rawurlencode($sms_message).'&sms_time='.$time;
- $code = dcurl('http://sms.destoon.com/send.php', $data);
- if($code && strpos($code, 'dt_sms_code=') !== false) {
- $code = explode('dt_sms_code=', $code);
- $code = $code[1];
- } else {
- $code = 'Can Not Connect SMS Server';
- }
- $db->query("INSERT INTO {$db->pre}sms (mobile,message,word,editor,sendtime,code) VALUES ('$mobile','$message','$word','$_username','$DT_TIME','$code')");
- return $code;
- }