本文整理匯總了PHP中misc::mail方法的典型用法代碼示例。如果您正苦於以下問題:PHP misc::mail方法的具體用法?PHP misc::mail怎麽用?PHP misc::mail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類misc
的用法示例。
在下文中一共展示了misc::mail方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cron_signtz_mail
function cron_signtz_mail()
{
global $m;
$today = date("Y-m-d");
$lastday = option::get('haotian_mail');
if ((time() - 1396281600) % 86400 < 21600) {
return '未到發送郵件時間';
}
if ($today != $lastday) {
option::set('haotian_mail', $today);
} else {
return '今日任務已經執行完畢';
}
$query = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users`");
while ($fetch = $m->fetch_array($query)) {
$mail = $fetch['email'];
$name = $fetch['name'];
$id = $fetch['id'];
if (option::uget('haotian_mail_enable', $id) == 1) {
$title = "[" . date("Y-m-d") . "] " . SYSTEM_NAME . " - {$name} - 簽到報告";
$query2 = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "tieba` WHERE `uid`={$id}");
$c = 0;
$content = '<p class="sign_title">' . SYSTEM_NAME . ' - 簽到報告</p><p>' . date("Y-m-d") . '<br>站點地址:<a href="' . SYSTEM_URL . '">' . SYSTEM_URL . '</a>' . '<br>若有大量貼吧簽到失敗,建議您重新設置 Cookie 相關信息</p><table class="result_table"><thead><tr><td style="width: 40px">#</td><td>貼吧</td><td style="width: 75px">狀態</td><td style="width: 75px">經驗</td></tr></thead><tbody>';
while ($ff = $m->fetch_array($query2)) {
$c++;
$tie8 = $ff['tieba'];
$status = $ff['status'];
$content .= "<tr><td>{$c}</td><td><a href=" . '"http://tieba.baidu.com/f?kw=' . urlencode($tie8) . '" target="_blank">' . $tie8 . '</a>' . "</td>";
if ($status == 0) {
$content .= "<td>已簽到</td><td>+8</td>";
} else {
$content .= "<td>簽到失敗</td><td>-</td>";
}
$content .= "</tr>";
}
$content .= "</tbody></table>";
$content = '<style type="text/css">div.wrapper * { font: 12px "Microsoft YaHei", arial, helvetica, sans-serif; word-break: break-all; }div.wrapper a { color: #15c; text-decoration: none; }div.wrapper a:active { color: #d14836; }div.wrapper a:hover { text-decoration: underline; }div.wrapper p { line-height: 20px; margin: 0 0 .5em; text-align: center; }div.wrapper .sign_title { font-size: 20px; line-height: 24px; }div.wrapper .result_table { width: 85%; margin: 0 auto; border-spacing: 0; border-collapse: collapse; }div.wrapper .result_table td { padding: 10px 5px; text-align: center; border: 1px solid #dedede; }div.wrapper .result_table tr { background: #d5d5d5; }div.wrapper .result_table tbody tr { background: #efefef; }div.wrapper .result_table tbody tr:nth-child(odd) { background: #fafafa; }</style><div class="wrapper">' . $content . '</div><br><p style="font-size: 12px; color: #9f9f9f; text-align: right; border-top: 1px solid #dedede; padding: 20px 10px 0; margin-top: 25px;">此封郵件來自 百度貼吧雲簽到<br>Haotian Mail API v0.1, 2014 © <a href="http://ihaotian.me/">Haotian\'s Laboratory</a>.</p>';
if ($c == 0) {
continue;
}
$x = misc::mail($mail, $title, $content);
if ($x != true) {
return '發送失敗,錯誤日誌:' . $x;
}
}
}
return '郵件發送成功!';
}
示例2: sendMail
/**
* 變量名稱
* @param $verifyKey 發送郵件中的key,用於驗證用戶身份是否與$verifyCode匹配
* @param $query SQL查詢語句
* @param $url 驗證鏈接地址
* @param $verifyCode 驗證碼
* @param $pluginName 插件名
*/
function sendMail($userMail, $uid)
{
global $m;
global $today;
$pluginName = 'white_vmail';
// 獲取8位數的隨機驗證碼並加密
$verifyCode = rand_int(8);
$verifyKey = sha1(md5($verifyCode));
$url = SYSTEM_URL . '?plugin=' . $pluginName . '&key=' . $verifyKey;
$title = '郵箱驗證 -- ' . SYSTEM_NAME;
$text = '親愛的用戶:<br><br>您好!<br><br>這是來自學園百度貼吧雲簽到平台的驗證郵件,用來驗證您的用戶郵箱。<br><br>請登錄學園百度貼吧雲簽到平台後點擊該鏈接,以便驗證你的郵箱。<br><br>提示:必須登錄後點擊!必須登錄後點擊!必須登錄後點擊! 否則無法驗證!謝謝合作!<br><br>係統將會自動清除注冊一定時間後沒驗證郵箱的用戶!<hr/>驗證鏈接:' . $url . '<br>(如果您無法點擊此鏈接,請將它複製到瀏覽器地址欄後訪問)<br><br><br>' . SYSTEM_NAME . '<br><br>(本郵件為係統自動發送,請勿回複)';
$mailResult = misc::mail($userMail, $title, $text);
if ($mailResult != TRUE) {
msg("向" . $userMail . "發送郵件失敗。");
}
$m->query("UPDATE " . DB_PREFIX . "users SET white_vmail_send = 1, white_vmail_code = " . $verifyCode . " WHERE id = " . $uid);
Redirect(SYSTEM_URL . "index.php?mod=admin:setplug&plug=white_vmail");
}
示例3: cron_wmzz_mailer
function cron_wmzz_mailer()
{
global $m;
$check = option::get('wmzz_mailer_check');
if ($check == '1') {
$text = option::get('wmzz_mailer_text');
$title = option::get('wmzz_mailer_title');
$limit = option::get('wmzz_mailer_limit');
$last = option::get('wmzz_mailer_last');
$done = 0;
$z = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` LIMIT {$last},{$limit}");
while ($v = $m->fetch_array($z)) {
$done++;
misc::mail($v['email'], $title, $text);
}
if ($done - $limit <= -1) {
option::set('wmzz_mailer_check', '0');
option::set('wmzz_mailer_last', '0');
cron::set('wmzz_mailer', 'plugins/wmzz_mailer/wmzz_mailer_cron.php', 1);
return '所有郵件群發任務於 ' . date('Y-m-d H:m:s') . ' 完成';
}
option::set('wmzz_mailer_last', $done + $last);
}
}
示例4: date
$dump .= 'MySQL Server Version : ' . $m->getMysqlVersion() . PHP_EOL;
$dump .= 'Date: ' . date('Y-m-d H:i:s') . PHP_EOL;
$dump .= '*/' . PHP_EOL . PHP_EOL;
$dump .= '-------------- Start --------------' . PHP_EOL . PHP_EOL;
$dump .= 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . PHP_EOL;
$dump .= 'SET FOREIGN_KEY_CHECKS=0;' . PHP_EOL;
$dump .= 'SET time_zone = "+8:00";' . PHP_EOL . PHP_EOL;
while ($v = $m->fetch_array($e)) {
$list = $v;
foreach ($list as $table) {
$dump .= dataBak($table);
}
}
$dump .= PHP_EOL . '-------------- End --------------';
$title = SYSTEM_NAME . " " . date('Y-m-d') . " 數據庫備份";
$x = misc::mail($email, $title, "備份文件已附上,請查看附件", array('backup-' . date('Ymd') . '.sql' => $dump));
if ($x != true) {
option::set('dl_backup_log', date('Y-m-d H:i:s') . ' 數據庫備份郵件發送失敗!');
ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&wrong');
} else {
option::set('dl_backup_log', date('Y-m-d H:i:s') . ' 數據庫備份郵件發送成功!');
ReDirect(SYSTEM_URL . 'index.php?mod=admin:setplug&plug=dl_backup&success');
}
}
}
?>
<h3>自動數據庫備份設置</h3><br/>
<form action="index.php?mod=admin:setplug&plug=dl_backup&set" method="post">
<div class="input-group">
<span class="input-group-addon">接收備份郵箱</span>
<input type="email" name="email" class="form-control" value="<?php
示例5: checkMail
?>
<?php
global $m;
if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'yz') {
$mail = !empty($_POST['mail']) ? checkMail($_POST['mail']) ? $_POST['mail'] : ReDirect('index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('郵箱地址不合法,請重新輸入')) : ReDirect('index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('郵箱地址為空,請重新輸入'));
$cx = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE email = '{$mail}' LIMIT 1");
$p = $m->fetch_array($cx);
if ($p == "") {
ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('錯誤:未能在本站找到持有該郵箱的用戶!'));
die;
}
$pw = sha1(md5(EncodePwd($p['pw'] . date('Ymd') . SYSTEM_NAME . SYSTEM_VER . SYSTEM_URL)));
$title = strip_tags(SYSTEM_NAME) . " - 找回密碼";
$text = "請點擊以下鏈接重置密碼:" . SYSTEM_URL . "index.php?pub_plugin=dl_zhmm" . '&page=yjqr' . '&email=' . base64_encode($mail) . '&key=' . $pw;
$x = misc::mail($mail, $title, $text);
if ($x != true) {
ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&error_msg=' . urlencode('錯誤:找回密碼郵件發送失敗,請檢查郵件相關設置!'));
} else {
ReDirect(SYSTEM_URL . 'index.php?pub_plugin=dl_zhmm&success_msg=' . urlencode('成功:郵件發送成功,請登錄郵箱按照提示操作!'));
}
}
if (isset($_GET['xg'])) {
global $m;
$emailcc = !empty($_REQUEST['email']) ? base64_decode($_REQUEST['email']) : msg('警告:郵件地址無效');
$email = checkMail($emailcc) ? sqladds($emailcc) : msg('警告:非法操作');
$key = $_REQUEST['key'];
$newpw = EncodePwd($_POST['pw']);
$cx = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "users` WHERE email = '{$email}' LIMIT 1");
$p = $m->fetch_array($cx);
if ($p == "") {
示例6: reg_supervise_yx
function reg_supervise_yx()
{
global $m;
$name = isset($_POST['user']) ? addslashes(strip_tags($_POST['user'])) : '';
$mail = isset($_POST['mail']) ? addslashes($_POST['mail']) : '';
$pw = isset($_POST['pw']) ? addslashes(strip_tags($_POST['pw'])) : '';
$role = 'banned';
$m->query('INSERT INTO `' . DB_NAME . '`.`' . DB_PREFIX . 'users` (`id`, `name`, `pw`, `email`, `role`, `t`) VALUES (NULL, \'' . $name . '\', \'' . EncodePwd($pw) . '\', \'' . $mail . '\', \'' . $role . '\', \'' . getfreetable() . '\');');
$ip = $_SERVER['REMOTE_ADDR'];
setcookie("reg_check", date('d'), time() + 86400);
$m->query('INSERT INTO `' . DB_NAME . '`.`' . DB_PREFIX . 'reg` (`ip`) VALUES (\'' . $ip . '\');');
$key = sha1(md5(EncodePwd($pw) . date('Ymd') . option::get(salt)));
$title = strip_tags(SYSTEM_NAME) . " - 注冊驗證";
$text = "你在" . SYSTEM_URL . " 使用IP:" . $ip . " 用此郵箱注冊了賬號,賬號:" . $name . ",密碼" . $pw . "<br>點擊以下鏈接完成安全驗證,即可正常使用本站服務。如果顯示禁止訪問,使用瀏覽器隱身模式再打開鏈接即可<br><p>本郵件為係統自動發送,請勿回複。如果你沒有進行此操作,可能是有人冒用了此郵箱,請不要點擊鏈接</p><br>驗證鏈接(當日有效):" . SYSTEM_URL . "index.php?pub_plugin=reg_supervise" . '&jh' . '&email=' . base64_encode($mail) . '&key=' . $key;
$x = misc::mail($mail, $title, $text);
if ($x != true) {
$m->query("UPDATE `" . DB_NAME . "`.`" . DB_PREFIX . "users` SET `role` = 'user' WHERE email = '{$mail}'");
$js = option::get('reg_jg');
option::set('reg_jg', $js + 1);
ReDirect(SYSTEM_URL . 'index.php?pub_plugin=reg_supervise&error_msg=驗證郵件發送失敗!已為你激活用戶!請登錄。');
die;
} else {
option::set('reg_jg', 0);
ReDirect(SYSTEM_URL . 'index.php?pub_plugin=reg_supervise&success_msg=請登錄你的郵箱點擊確認鏈接!否則無法登陸本站!');
}
die;
}
示例7: msg
msg('郵箱格式有誤,請檢查');
}
}
$set = array();
foreach ($PostArray as $value) {
if (!isset($i['post'][$value])) {
$i['post'][$value] = '';
}
@option::uset($value, $i['post'][$value]);
}
doAction('set_save2');
Redirect('index.php?mod=set&ok');
break;
case 'admin:testmail':
global $i;
$x = misc::mail($i['user']['email'], SYSTEM_FN . ' V' . SYSTEM_VER . ' - 郵件發送測試', '這是一封關於 ' . SYSTEM_FN . ' 的測試郵件,如果你收到了此郵件,表示郵件係統可以正常工作<br/><br/>站點地址:' . SYSTEM_URL, array('測試附件.txt' => '這是一個測試附件'));
if ($x === true) {
Redirect('index.php?mod=admin:set&mailtestok');
} else {
msg('郵件發送失敗,發件日誌:<br/>' . $x);
}
break;
case 'admin:testbbs':
global $i;
$ch_url = SUPPORT_URL . 'getplug.php?m=check&user=' . option::get('bbs_us') . '&pw=' . option::get('bbs_pw');
$c = new wcurl($ch_url);
$x = $c->exec();
$c->close();
if ($x == 'RIGHT') {
Redirect('index.php?mod=admin:set&bbstestok');
} else {
示例8: json_encode
break;
}
if ($m->query('Delete From ' . DB_PREFIX . 'users Where id=' . $_GET["uid"])) {
if (SYSTEM_VER >= 3.4) {
$m->query('Delete From ' . DB_PREFIX . 'users_options Where uid=' . $_GET["uid"]);
}
$ary["status"] = "true";
} else {
$ary["status"] = "false";
$ary["msg"] = "數據庫錯誤,刪除失敗";
}
echo json_encode($ary);
}
break;
case 'mail':
if (isset($_GET["id"])) {
$ret = $m->once_fetch_array('Select email From ' . DB_PREFIX . 'users Where id=' . $_GET["id"]);
if (isset($ret['email']) && $ret['email'] != '') {
$x = misc::mail($ret['email'], '你在雲簽中綁定的百度帳號過期了 - 來自BDUSS有效性檢測插件', '你在' . SYSTEM_URL . '雲簽中綁定的百度帳號過期了,這將導致無法繼續簽到,請登錄並重新綁定');
if ($x === true) {
echo json_encode(array('status' => 'true'));
} else {
echo json_encode(array('status' => 'false', 'msg' => '郵件發送失敗,請檢查郵件綜合設置 '));
}
} else {
echo json_encode(array('status' => 'false', 'msg' => '沒有找到該用戶的E-mail'));
}
}
break;
}
}
示例9: die
<?php
if (!defined('SYSTEM_ROOT')) {
die('Insufficient Permissions');
}
$last = option::get('dl_yjtz_last');
if ($last != date('Y-m-d')) {
global $m;
$max = $m->fetch_array($m->query("select max(id) as id from `" . DB_NAME . "`.`" . DB_PREFIX . "users`"));
$max = $max['id'];
$lastdo = option::get('dl_yjtz_time');
for ($ii = $lastdo; $ii <= $max; $ii++) {
$user = $m->fetch_array($m->query('select * from `' . DB_NAME . '`.`' . DB_PREFIX . 'users` where `id` = ' . $ii));
if (!empty($user['email'])) {
$op = $m->fetch_array($m->query('select * from `' . DB_NAME . '`.`' . DB_PREFIX . 'users_options` where `uid` = ' . $user['id'] . ' and `name` = "dl_yjtz_enable"'));
if ($op['value'] == 1) {
$url = SYSTEM_URL . 'index.php?pub_plugin=dl_yjtz&username=' . $user['name'] . '&token=' . md5(md5(md5(md5($user['name'] . $user['pw'] . date('Y-m-d')))));
$x = misc::mail($user['email'], SYSTEM_NAME . '-簽到通知', '您可通過此鏈接查看您的當日簽到情況(次日自動失效):<a href="' . $url . '">' . $url . '</a>');
option::set('dl_yjtz_time', $ii);
}
}
}
if (option::get('dl_yjtz_time') >= $max) {
option::set('dl_yjtz_time', 0);
}
option::set('dl_yjtz_last', date('Y-m-d'));
}
示例10: json_encode
break;
}
if ($m->query('Delete From ' . DB_PREFIX . 'users Where id=' . $_GET["uid"])) {
if (SYSTEM_VER >= 3.4) {
$m->query('Delete From ' . DB_PREFIX . 'users_options Where uid=' . $_GET["uid"]);
}
$ary["status"] = "true";
} else {
$ary["status"] = "false";
$ary["msg"] = "數據庫錯誤,刪除失敗";
}
echo json_encode($ary);
}
break;
case 'mail':
if (isset($_GET["id"])) {
$ret = $m->once_fetch_array('Select email From ' . DB_PREFIX . 'users Where id=' . $_GET["id"]);
if (isset($ret['email']) && $ret['email'] != '') {
$x = misc::mail($ret['email'], '綁定帳號過期通知 - ' . strip_tags(SYSTEM_NAME), '<br>您好:<p>您在 ' . SYSTEM_URL . ' ' . SYSTEM_NAME . ' 中綁定的百度帳號過期了,這將導致無法繼續簽到,請登錄並重新綁定!</p><p>溫馨提示:建議一個月更新一次綁定信息,以便保證穩定簽到!</p><br /><p>' . SYSTEM_NAME . '</p><p>' . date("Y-n-j H:i:s") . '</p>');
if ($x === true) {
echo json_encode(array('status' => 'true'));
} else {
echo json_encode(array('status' => 'false', 'msg' => '郵件發送失敗,請檢查郵件綜合設置 '));
}
} else {
echo json_encode(array('status' => 'false', 'msg' => '沒有找到該用戶的E-mail'));
}
}
break;
}
}