本文整理汇总了PHP中mailer::setRecipient方法的典型用法代码示例。如果您正苦于以下问题:PHP mailer::setRecipient方法的具体用法?PHP mailer::setRecipient怎么用?PHP mailer::setRecipient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailer
的用法示例。
在下文中一共展示了mailer::setRecipient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Form to email a member
*
* @author Jason Warner <jason@mercuryboard.com>
* @since RC1
**/
function execute()
{
$this->set_title($this->lang->email_email);
$this->tree($this->lang->email_email);
if (!$this->perms->auth('email_use')) {
return $this->message($this->lang->email_email, $this->lang->email_no_perm);
}
if (!isset($this->post['submit'])) {
$this->get['to'] = isset($this->get['to']) ? intval($this->get['to']) : '';
if ($this->get['to']) {
$target = $this->db->fetch("SELECT user_name FROM {$this->pre}users WHERE user_id={$this->get['to']}");
if (!isset($target['user_name']) || $this->get['to'] == USER_GUEST_UID) {
return $this->message($this->lang->email_email, $this->lang->email_no_member);
}
$this->get['to'] = $target['user_name'];
}
return eval($this->template('EMAIL_MAIN'));
} else {
if (empty($this->post['to']) || empty($this->post['message']) || empty($this->post['subject'])) {
return $this->message($this->lang->email_email, $this->lang->email_no_fields);
}
$target = $this->db->fetch("SELECT user_id, user_email, user_email_form FROM {$this->pre}users WHERE user_name='{$this->post['to']}'");
if (!$target['user_email_form']) {
return $this->message($this->lang->email_email, $this->lang->email_blocked);
}
if (!isset($target['user_id']) || $target['user_id'] == USER_GUEST_UID) {
return $this->message($this->lang->email_email, $this->lang->email_no_member);
}
include './lib/mailer.php';
$mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
$mailer->setSubject("{$this->sets['forum_name']} - {$this->post['subject']}");
$mailer->setMessage("This mail has been sent by {$this->user['user_name']} via {$this->sets['forum_name']}\n\n" . stripslashes($this->post['message']));
$mailer->setRecipient($target['user_email']);
$mailer->setServer($this->sets['mailserver']);
$mailer->doSend();
return $this->message($this->lang->email_email, $this->lang->email_sent);
}
}
示例2: mailer
function send_activation_email($email, $username, $pass, $jointime)
{
include './lib/mailer.php';
$mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
$message = "{$this->lang->register_email_msg}\n";
$message .= "{$this->lang->register_email_msg2} {$this->sets['forum_name']}.\n\n";
$message .= "{$this->lang->register_email_msg3}\n";
$message .= "{$this->sets['loc_of_board']}{$this->mainfile}?a=register&s=activate&e=" . md5($email . $username . $pass . $jointime);
$mailer->setSubject("{$this->sets['forum_name']} - {$this->lang->register_activating}");
$mailer->setMessage($message);
$mailer->setRecipient($email);
$mailer->setServer($this->sets['mailserver']);
$mailer->doSend();
return $this->message($this->lang->register_reging, sprintf($this->lang->register_must_activate, $email));
}
示例3: mailer
function request_pass()
{
$this->set_title($this->lang->login_pass_reset);
$this->tree($this->lang->login_pass_reset);
if (!isset($this->get['e'])) {
$this->get['e'] = null;
}
$target = $this->db->fetch("SELECT user_id, user_name, user_email FROM {$this->pre}users WHERE MD5(CONCAT(user_email, user_name, user_password, user_joined))='" . preg_replace('/[^a-z0-9]/', '', $this->get['e']) . '\' AND user_id != ' . USER_GUEST_UID . ' LIMIT 1');
if (!isset($target['user_id'])) {
return $this->message($this->lang->login_pass_reset, $this->lang->login_pass_no_id);
}
include './lib/mailer.php';
$mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
$newpass = $this->generate_pass(8);
$message = "{$this->sets['forum_name']}\n\n";
$message .= "Your password has been reset to:\n{$newpass}\n\n";
$message .= "{$this->sets['loc_of_board']}{$this->mainfile}?a=login";
$mailer->setSubject("{$this->sets['forum_name']} - Reset Password");
$mailer->setMessage($message);
$mailer->setRecipient($target['user_email']);
$mailer->setServer($this->sets['mailserver']);
$mailer->doSend();
$this->db->query("UPDATE {$this->pre}users SET user_password='" . md5($newpass) . "' WHERE user_id={$target['user_id']}");
return $this->message($this->lang->login_pass_reset, $this->lang->login_pass_sent);
}
示例4: mailer
function send_activation_email($email, $username, $pass, $jointime)
{
include './lib/mailer.php';
$mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
$message = "This is an automated email generated by MercuryBoard, and sent to you in order\n";
$message .= "for you to activate your account with {$this->sets['forum_name']}.\n\n";
$message .= "Please click the following link, or paste it in to your web browser:\n";
$message .= "{$this->sets['loc_of_board']}{$this->self}?a=register&s=activate&e=" . md5($email . $username . $pass . $jointime);
$mailer->setSubject("{$this->sets['forum_name']} - Activating Your Account");
$mailer->setMessage($message);
$mailer->setRecipient($email);
$mailer->setServer($this->sets['mailserver']);
$mailer->doSend();
return $this->message($this->lang->register_reging, sprintf($this->lang->register_must_activate, $email));
}