当前位置: 首页>>代码示例>>PHP>>正文


PHP admin::mail方法代码示例

本文整理汇总了PHP中admin::mail方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::mail方法的具体用法?PHP admin::mail怎么用?PHP admin::mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在admin的用法示例。


在下文中一共展示了admin::mail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: time

                $i++;
            }
            $database->query("UPDATE " . TABLE_PREFIX . "users SET password = '" . md5($new_pass) . "', last_reset = '" . time() . "' WHERE user_id = '" . $results_array['user_id'] . "'");
            if ($database->is_error()) {
                // Error updating database
                $message = $database->get_error();
            } else {
                // Setup email to send
                $mail_to = $email;
                $mail_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'];
                // Replace placeholders from language variable with values
                $search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
                $replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass);
                $mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2_BODY_LOGIN_FORGOT']);
                // Try sending the email
                if ($admin->mail(SERVER_EMAIL, $mail_to, $mail_subject, $mail_message)) {
                    $message = $MESSAGE['FORGOT_PASS_PASSWORD_RESET'];
                    $display_form = false;
                } else {
                    $database->query("UPDATE " . TABLE_PREFIX . "users SET password = '" . $old_pass . "' WHERE user_id = '" . $results_array['user_id'] . "'");
                    $message = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL'];
                }
            }
        }
    } else {
        // Email doesn't exist, so tell the user
        $message = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
        // and delete the wrong Email
        $email = '';
    }
} else {
开发者ID:wyg3958,项目名称:WebsiteBaker_CommunityEdition,代码行数:31,代码来源:index.php

示例2: realpath

    }
}
// end include class.secure.php
global $TEXT;
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/html; charset:utf-8;");
// not needed, config is loaded with class.secure
// include realpath(dirname(__FILE__)).'/../../config.php';
include realpath(dirname(__FILE__)) . '/../../framework/class.admin.php';
$admin = new admin('Settings', 'settings_basic');
$curr_user_is_admin = in_array(1, $admin->get_groups_id());
if (!$curr_user_is_admin) {
    echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>You're not allowed to use this function!</div>";
    exit;
}
$settings = array();
$sql = 'SELECT `name`, `value` FROM `' . TABLE_PREFIX . 'settings`';
if ($res_settings = $database->query($sql)) {
    while ($row = $res_settings->fetchRow()) {
        $settings[strtoupper($row['name'])] = $row['name'] != 'wbmailer_smtp_password' ? htmlspecialchars($row['value']) : $row['value'];
    }
}
ob_clean();
// send mail
if ($admin->mail($settings['SERVER_EMAIL'], $settings['SERVER_EMAIL'], 'LEPTON PHP MAILER', $TEXT['WBMAILER_TESTMAIL_TEXT'])) {
    echo "<div style='border: 2px solid #006600; padding: 5px; text-align: center; background-color: #dff2bf;'>", $TEXT['WBMAILER_TESTMAIL_SUCCESS'], "</div>";
} else {
    $message = ob_get_clean();
    echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>", $TEXT['WBMAILER_TESTMAIL_FAILED'], "<br />{$message}<br /></div>";
}
开发者ID:pixelhulk,项目名称:LEPTON,代码行数:31,代码来源:ajax_testmail.php


注:本文中的admin::mail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。