<?php require 'fetion.php'; $fetion = new PHPFetion($_POST["user"], $_POST["key"]); // 手机号、飞信密码 $result = $fetion->send($_POST["number"], $_POST["text"]); // 接收人手机号、飞信内容 ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <?php if (strpos($result, '请输入密码')) { //登录失败 echo "D"; } else { if (strpos($result, 'NoMessage')) { //发送的消息为空 echo "K"; } else { if (strpos($result, '限制在500字')) { //发送内容超长 echo "L"; } else { if (strpos($result, '短信发送成功!')) { //给自己发送成功 echo "M"; } else {
<?php require 'lib/PHPFetion.php'; $phone = '飞信好嘛'; $pwd = '微信密码'; $to = '要发送的人的手机好嘛'; $msg = '要发送的信息'; $fetion = new PHPFetion($phone, $pwd); // 手机号、飞信密码 if ($fetion->send($to, $msg)) { echo "发送成功"; } else { echo "发送失败,请重试!"; }
public static function sendSMS($message, $to = self::SMS_USERNAME) { $fetion = new PHPFetion(self::SMS_USERNAME, self::SMS_PASSWORD); $fetion->send($to, $message); }
private function send_fetion($user, $paydata, $type = 1) { if (!class_exists('PHPFetion')) { require_once 'Public/PHPFetion.php'; } $config = M('config')->where('id=1')->find(); $fetion_setting = json_decode($config['fetion_setting'], true); $fetion = new PHPFetion($fetion_setting['sender'], $fetion_setting['password']); $domain = '[' . $_SERVER['HTTP_HOST'] . ']'; if ($type == 1) { $replace_array = array('{username}' => $user['username'], '{outer_order_no}' => $paydata['outer_order_no'], '{order_money}' => round($paydata['pay_money'], 2), '{user_qq}' => $user['user_qq'], '{money}' => $paydata['money'], '{addtime}' => $paydata['addtime']); $content = $fetion_setting['jk_tixing']; } else { if ($type == 2) { $replace_array = array('{username}' => $user['username'], '{user_qq}' => $user['user_qq'], '{money}' => $paydata['money'], '{addtime}' => $paydata['addtime']); $content = $fetion_setting['tx_tixing']; } } $content = strtr($content, $replace_array); $content = $content . $domain; $fetion->send($fetion_setting['receiver'], $content); }
<?php require '../lib/PHPFetion.php'; $fetion = new PHPFetion('13500001111', '123123'); // 手机号、飞信密码 $fetion->send('13500001111', 'Hello!'); // 接收人手机号、飞信内容
function SendSMS($tel, $pwd, $to = '', $text = '') { require ROOT_PATH . '/source/api/PHPFetion.php'; $fetion = new PHPFetion($tel, $pwd); $fetion->send($to, $text); }
<?php require './PHPFetion.php'; $fetion = new PHPFetion('15117985354', 'xtha1103'); // 手机号、飞信密码 $fetion->send('15117985354', 'Hello!'); // 接收人手机号、飞信内容
<?php require '../lib/PHPFetion.php'; $fetion = new PHPFetion('15838348705', 'adgjmp123'); // 手机号、飞信密码 $fetion->send('15838348705', 'Hello!'); // 接收人手机号、飞信内容