페이지 정보

본문
아이코드로 LMS 발송 할 경우
<?php
/* www/extend/user.config.php */
// 문자 발송 함수
function lmsSend($sHp, $rHp, $msg) {
global $g5, $config;
$rtn = "";
try {
$send_hp = str_replace("-","",$sHp); // - 제거
$recv_hp = str_replace("-","",$rHp); // - 제거
$strDest = array();
$strDest[0] = $recv_hp;
$SMS = new LMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'],
$config['cf_icode_id'],
$config['cf_icode_pw'],
'1');
$SMS->Add($strDest,
$send_hp,
$config['cf_icode_id'],
"",
"",
iconv("utf-8", "euc-kr", $msg),
"",
"1");
// iconv("utf-8", "euc-kr", stripslashes($msg)),
// 메세지에서 특수문자를 제거하여 발송하려면 stripslashes를 추가하세요
$SMS->Send();
$rtn = true;
}
catch(Exception $e) {
alert("처리중 문제가 발생했습니다.".$e->getMessage());
$rtn = false;
}
return $rtn;
}
?>
사용하는 예제는 실제 사용하실 영역에 다음과 같이 사용
<?php
include_once(G5_LIB_PATH.'/icode.lms.lib.php');
...
$sHp = "010-0000-0000"; // 발송번호
$rHp = "010-0000-0000"; // 수신번호
$msg = "문자발송하실 내용"; //발송내용
if (lmsSend($sHp,$rHp,$msg))
alert('정상발송');
else
alert('발송오류');
?>
댓글목록
등록된 댓글이 없습니다.