本文整理汇总了PHP中Emails::sendPlain方法的典型用法代码示例。如果您正苦于以下问题:PHP Emails::sendPlain方法的具体用法?PHP Emails::sendPlain怎么用?PHP Emails::sendPlain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emails
的用法示例。
在下文中一共展示了Emails::sendPlain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: t
<?php
include_once $home_dir . 'classes/emails.php';
$page_title = t('Forgotten Password');
if (isset($_POST['email'])) {
$zUser = new User($db);
$zUser->loadByLoginOrEmail($_POST['email']);
if ($zUser->is_loaded) {
$reset_token = generateToken(50);
$expires = time() + 60 * 60 * 24 * User::$reset_password_expires_days;
$zUser->data['user_reset_password_hash'] = Authentication::hashPassword($reset_token);
$zUser->data['user_reset_password_expires'] = ModelBase::mysqlTimestamp($expires);
$zUser->save();
$email_text = t('To reset your password, visit this link: %s/admin/reset-password/%d?reset_token=%s. This link is only valid for %d days.', $base_url, $zUser->val('user_id'), $reset_token, User::$reset_password_expires_days);
Emails::sendPlain($globals['emails_from'], $zUser->val('user_email'), '', t('Forgotten Password'), $email_text);
$messages->add(t('An e-mail was sent to your address with reset password instructions.'));
} else {
// increase ip address failed attempts here
// *
$messages->error(t('This e-mail address or login was not found in our database.'));
}
}