close
<?php
//發簡訊設定
$username = "號碼";
$password = "密碼";
$phone = "手機號碼";
$sms_url = 'http://smexpress.mitake.com.tw:9600/SmSendGet.asp?username='.$username.'&password='.$password.'&dstaddr='.$phone.'&DestName=測試&dlvtime=&vldtime=&encoding=UTF8&smbody=這是使用PHP Sample測試發送';
// 建立CURL連線
$ch = curl_init();
$timeout = 5;
//設定port
//curl_setopt($ch, CURLOPT_PORT, 9600);
// 設定擷取的URL網址
curl_setopt($ch, CURLOPT_URL, $sms_url);
curl_setopt($ch, CURLOPT_HEADER, false);
//將curl_exec()獲取的訊息以文件流的形式返回,而不是直接輸出。
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//設定抓取時間
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// 執行
$file_contents = curl_exec($ch);
// 關閉CURL連線
curl_close($ch);
echo $file_contents;
?>
全站熱搜