Ejemplo n.º 1
0
     $result = $_CLASS['core_db']->query($sql);
     */
     require_once SITE_FILE_ROOT . 'includes/mailer.php';
     $mailer = new core_mailer();
     if ($topic_id) {
         $template = 'email_notify.txt';
         $email = $email;
         $subject = $row['topic_title'];
     } else {
         $template = 'profile_send_email.txt';
         $email = $row['user_email'];
         $name = $row['username'];
         $subject .= 'Email a friend';
     }
     $mailer->to($email, $name);
     $mailer->reply_to($_CLASS['core_user']->data['user_email'], $_CLASS['core_user']->data['username']);
     $mailer->subject($subject);
     if ($cc) {
         $mailer->cc($_CLASS['core_user']->data['user_email'], $_CLASS['core_user']->data['username']);
     }
     //$mailer->extra_header('X-AntiAbuse: Board servername - ' . $config['server_name']);
     $mailer->extra_header('X-AntiAbuse: User_id - ' . $_CLASS['core_user']->data['user_id']);
     $mailer->extra_header('X-AntiAbuse: Username - ' . $_CLASS['core_user']->data['username']);
     $mailer->extra_header('X-AntiAbuse: User IP - ' . $_CLASS['core_user']->ip);
     $_CLASS['core_template']->assign_array(array('SITENAME' => $_CORE_CONFIG['global']['site_name'], 'BOARD_EMAIL' => $config['board_contact'], 'FROM_USERNAME' => $_CLASS['core_user']->data['username'], 'TO_USERNAME' => $topic_id ? $name : $row['username'], 'MESSAGE' => $message, 'TOPIC_NAME' => $topic_id ? strtr($row['topic_title'], array_flip(get_html_translation_table(HTML_ENTITIES))) : '', 'U_TOPIC' => $topic_id ? generate_link('Forums&file=viewforum&f=' . $row['forum_id'] . "&t={$topic_id}", array('full' => true, 'sid' => false)) : ''));
     $mailer->message = trim($_CLASS['core_template']->display('email/members_list/' . $template, true));
     $mailer->send();
     $_CLASS['core_display']->meta_refresh(3, generate_link());
     $message = !$topic_id ? sprintf($_CLASS['core_user']->lang['RETURN_INDEX'], '<a href="' . generate_link() . '">', '</a>') : sprintf($_CLASS['core_user']->lang['RETURN_TOPIC'], '<a href="' . generate_link("Forums&amp;file=viewtopic&amp;f={$forum_id}&amp;t=" . $row['topic_id']) . '">', '</a>');
     trigger_error($_CLASS['core_user']->lang['EMAIL_SENT'] . '<br /><br />' . $message);
 }