本文整理汇总了PHP中mailer::setBcc方法的典型用法代码示例。如果您正苦于以下问题:PHP mailer::setBcc方法的具体用法?PHP mailer::setBcc怎么用?PHP mailer::setBcc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mailer
的用法示例。
在下文中一共展示了mailer::setBcc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function send_mail()
{
if (!isset($this->post['groups'])) {
$this->post['groups'] = array();
}
include '../lib/mailer.php';
$mailer = new mailer($this->sets['admin_incoming'], $this->sets['admin_outgoing'], $this->sets['forum_name'], false);
$mailer->setSubject($this->post['subject']);
$message = stripslashes($this->post['message']) . "\n";
$message .= '___________________' . "\n";
$message .= $this->sets['forum_name'] . "\n";
$message .= $this->sets['loc_of_board'] . "\n";
$mailer->setMessage($message);
$mailer->setServer($this->sets['mailserver']);
$i = 0;
$members = $this->db->query("SELECT user_email FROM {$this->pre}users" . $this->group_query($this->post['groups']));
while ($sub = $this->db->nqfetch($members)) {
$mailer->setBcc($sub['user_email']);
$i++;
}
$mailer->doSend();
return $this->message('Mass Mail', 'Your message has been sent to ' . $i . ' members.');
}
示例2: makePost
//.........这里部分代码省略.........
if (!isset($this->post['icon'])) {
$this->post['icon'] = '';
}
if (!isset($this->post['parseCode'])) {
$this->post['parseCode'] = 0;
}
if (!isset($this->post['parseEmot'])) {
$this->post['parseEmot'] = 0;
}
if ($this->post['parseCode'] && !$this->quote_check($this->post['post'])) {
$this->post['parseCode'] = 0;
}
if ($s == 'topic' || $s == 'poll') {
$mode = 0;
if ($this->perms->auth('topic_global') && isset($this->post['global_topic'])) {
$mode |= TOPIC_GLOBAL;
}
if (trim($this->post['title']) == '') {
return $this->message($this->lang->post_posting, $this->lang->post_must_title);
}
if ($s == 'poll') {
if (trim($this->post['options']) == '') {
return $this->message($this->lang->post_posting, $this->lang->post_must_options);
}
$max_options = 15;
$option_count = substr_count($this->post['options'], "\n") + 1;
if ($option_count > $max_options || $option_count < 2) {
return $this->message($this->lang->post_posting, sprintf($this->lang->post_too_many_options, $max_options));
}
}
$this->sets['topics']++;
if ($s != 'poll') {
$this->db->query("INSERT INTO {$this->pre}topics (topic_title, topic_forum, topic_description, topic_starter, topic_icon, topic_edited, topic_last_poster, topic_modes) VALUES ('{$this->post['title']}', {$this->get['f']}, '{$this->post['desc']}', {$this->user['user_id']}, '{$this->post['icon']}', {$this->time}, {$this->user['user_id']}, {$mode})");
} else {
$mode |= TOPIC_POLL;
$this->db->query("INSERT INTO {$this->pre}topics (topic_title, topic_forum, topic_description, topic_starter, topic_icon, topic_edited, topic_last_poster, topic_modes, topic_poll_options) VALUES ('{$this->post['title']}', {$this->get['f']}, '{$this->post['desc']}', {$this->user['user_id']}, '{$this->post['icon']}', {$this->time}, {$this->user['user_id']}, {$mode}, '{$this->post['options']}')");
}
$this->get['t'] = $this->db->insert_id();
}
$newlevel = $this->get_level($this->user['user_posts'] + 1);
if ($this->user['user_title_custom']) {
$membertitle = $this->user['user_title'];
} else {
$membertitle = $newlevel['user_title'];
}
$this->sets['posts']++;
$this->write_sets();
/*
if (isset($this->post['rich'])) {
$this->post['post'] = $this->format_html_mbcode($this->post['post']);
}
*/
$this->db->query("INSERT INTO {$this->pre}posts (post_topic, post_author, post_text, post_time, post_emoticons, post_mbcode, post_ip, post_icon) VALUES ({$this->get['t']}, {$this->user['user_id']}, '{$this->post['post']}', {$this->time}, {$this->post['parseEmot']}, {$this->post['parseCode']}, INET_ATON('{$this->ip}'), '{$this->post['icon']}')");
$post_id = $this->db->insert_id();
$this->db->query("UPDATE {$this->pre}users SET user_posts=user_posts+1, user_lastpost='{$this->time}', user_level='{$newlevel['user_level']}', user_title='" . addslashes($membertitle) . "' WHERE user_id='{$this->user['user_id']}'");
if ($s == 'reply') {
$this->db->query("UPDATE {$this->pre}topics SET topic_replies=topic_replies+1, topic_edited={$this->time}, topic_last_poster={$this->user['user_id']} WHERE topic_id={$this->get['t']}");
$field = 'forum_replies';
} else {
$field = 'forum_topics';
}
// Update all parent forums if any
$forums = $this->db->fetch("SELECT forum_tree FROM {$this->pre}forums WHERE forum_id={$this->get['f']}");
$this->db->query("UPDATE {$this->pre}forums SET {$field}={$field}+1, forum_lastpost={$post_id} WHERE forum_parent > 0 AND forum_id IN ({$forums['forum_tree']}) OR forum_id={$this->get['f']}");
if (isset($this->post['attached_data']) && $this->perms->auth('post_attach', $this->get['f'])) {
$this->attachmentutil->insert($post_id, $this->post['attached_data']);
}
$this->db->query("DELETE FROM {$this->pre}subscriptions WHERE subscription_expire < {$this->time}");
$subs = $this->db->query("\n\t\t\tSELECT\n\t\t\t u.user_email\n\t\t\tFROM\n\t\t\t {$this->pre}subscriptions s,\n\t\t\t {$this->pre}users u\n\t\t\tWHERE\n\t\t\t s.subscription_user = u.user_id AND\n\t\t\t u.user_id != {$this->user['user_id']} AND\n\t\t\t ((s.subscription_type = 'topic' AND s.subscription_item = {$this->get['t']}) OR\n\t\t\t (s.subscription_type = 'forum' AND s.subscription_item = {$this->get['f']}))");
if ($this->db->num_rows($subs)) {
$emailtopic = $this->db->fetch("\n\t\t\t\tSELECT\n\t\t\t\t\tt.topic_title,\n\t\t\t\t\tf.forum_name\n\t\t\t\tFROM\n\t\t\t\t\t{$this->pre}topics t,\n\t\t\t\t\t{$this->pre}forums f\n\t\t\t\tWHERE\n\t\t\t\t\tt.topic_id={$this->get['t']} AND\n\t\t\t\t\tt.topic_forum=f.forum_id");
$message = "{$this->sets['forum_name']}\n";
$message .= "{$this->sets['loc_of_board']}{$this->mainfile}?a=topic&t={$this->get['t']}\n\n";
$message .= "A new post has been made in a topic or forum you are subscribed to.\n\n";
$message .= "Forum: {$emailtopic['forum_name']}\n";
$message .= "Topic: " . $this->format($emailtopic['topic_title'], FORMAT_CENSOR);
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']} - Subscriptions");
$mailer->setMessage($message);
$mailer->setServer($this->sets['mailserver']);
while ($sub = $this->db->nqfetch($subs)) {
$mailer->setBcc($sub['user_email']);
}
$mailer->doSend();
}
if ($s == 'reply') {
$topic['topic_replies']++;
if ($topic['topic_replies'] >= $this->sets['posts_per_page']) {
$min = floor($topic['topic_replies'] / $this->sets['posts_per_page']) * $this->sets['posts_per_page'];
$jump = "&min={$min}#p" . ($topic['topic_replies'] - $min);
} else {
$jump = '#p' . $topic['topic_replies'];
}
header('Location: ' . $this->self . '?a=topic&t=' . $this->get['t'] . $jump);
} else {
header('Location: ' . $this->self . '?a=topic&t=' . $this->get['t']);
}
}
}