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


PHP emailer::send方法代码示例

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


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

示例1: home

    function home()
    {
        global $user;
        $sql = 'SELECT *
			FROM _email
			WHERE email_active = ??
			LIMIT ??';
        if (!($email = _fieldrow(sql_filter($sql, 1, 1)))) {
            $this->e('No queue emails.');
        }
        set_time_limit(0);
        if (!$email['email_start']) {
            $sql = 'UPDATE _email SET email_start = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, time(), $email['email_id']));
        }
        $sql = 'SELECT user_id, user_username, user_email
			FROM _members
			WHERE user_type = ?
				AND user_id <> ?
			ORDER BY user_username
			LIMIT ??, ??';
        $members = _rowset(sql_filter($sql, 1, 1, $email['email_last'], 100));
        $i = 0;
        foreach ($members as $row) {
            if (!preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $row['user_email'])) {
                continue;
            }
            if (!$i) {
                include XFS . 'core/emailer.php';
                $emailer = new emailer();
            }
            $emailer->use_template('mass');
            $emailer->format('plain');
            $emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
            $emailer->set_subject(entity_decode($email['email_subject']));
            $emailer->email_address($row['user_email']);
            $emailer->assign_vars(array('USERNAME' => $row['user_username'], 'MESSAGE' => entity_decode($email['email_message'])));
            $emailer->send();
            $emailer->reset();
            sleep(2);
            $i++;
        }
        if ($i) {
            $email['email_last'] += $i;
            $sql = 'UPDATE _email SET email_last = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, $email['email_last'], $email['email_id']));
        } else {
            $sql = 'UPDATE _email SET email_active = ?, email_end = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, 0, time(), $email['email_id']));
            $this->e('Finished processing [' . $email['email_id'] . '] emails.');
        }
        $this->e('Processed ' . $i . ' emails.');
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:57,代码来源:_email.php

示例2: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return false;
		}

		$username1 = request_var('username1', '');
		$username2 = request_var('username2', '');
		if (empty($username1) || empty($username2)) {
			fatal_error();
		}

		$username_base1 = get_username_base($username1);
		$username_base2 = get_username_base($username2);

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if (!$userdata = sql_fieldrow(sql_filter($sql, $username_base1))) {
			_pre('El usuario no existe.', true);
		}

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if ($void = sql_fieldrow(sql_filter($sql, $username_base2))) {
			_pre('El usuario ya existe.', true);
		}

		//
		$sql = 'UPDATE _members SET username = ?, username_base = ?
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $username2, $username_base2, $userdata['user_id']));

		$emailer = new emailer();

		$emailer->from('info');
		$emailer->use_template('username_change', $config['default_lang']);
		$emailer->email_address($userdata['user_email']);

		$emailer->assign_vars(array(
			'USERNAME' => $userdata['username'],
			'NEW_USERNAME' => $username2,
			'U_USERNAME' => s_link('m', $username_base2))
		);
		$emailer->send();
		$emailer->reset();

		redirect(s_link('m', $username_base2));

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:53,代码来源:user_name_change.php

示例3: home

    function home()
    {
        $sql = 'SELECT *
			FROM _members
			WHERE user_type = ?
				AND user_birthday LIKE ?
				AND user_birthday_last < ?
			ORDER BY user_username
			LIMIT ??';
        $birthday = _rowset(sql_filter($sql, 1, '%' . date('md'), date('Y'), 10));
        if (!$birthday) {
            $this->e('None.');
        }
        $process = w();
        foreach ($birthday as $i => $row) {
            if (!$i) {
                @set_time_limit(0);
                require XFS . 'core/emailer.php';
                $emailer = new emailer();
            }
            $emailer->format('plain');
            $emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
            $emailer->use_template('user_birthday');
            $emailer->email_address($row['user_email']);
            $emailer->assign_vars(array('USERNAME' => $row['user_username']));
            $emailer->send();
            $emailer->reset();
            $process[$row['user_id']] = $row['user_username'];
        }
        if (count($process)) {
            $sql = 'UPDATE _members SET user_birthday_last = ?
				WHERE user_id IN (??)';
            _sql(sql_filter($sql, date('Y'), _implode(',', array_keys($process))));
        }
        return $this->e('Done @ ' . implode(',', array_values($process)));
    }
开发者ID:nopticon,项目名称:noptc,代码行数:36,代码来源:_birthday.php

示例4: album_comment_notify

function album_comment_notify($pic_id)
{
    global $db, $config, $user, $lang, $album_config;
    // One row SQL for caching purpose...
    $sql = "SELECT ban_userid FROM " . BANLIST_TABLE . " WHERE ban_userid <> 0 ORDER BY ban_userid ASC";
    $result = $db->sql_query($sql, 0, 'ban_', USERS_CACHE_FOLDER);
    $user_id_sql = '';
    while ($row = $db->sql_fetchrow($result)) {
        if (isset($row['ban_userid']) && !empty($row['ban_userid'])) {
            $user_id_sql .= ', ' . $row['ban_userid'];
        }
    }
    $sql = "SELECT u.user_id, u.user_email, u.user_lang, p.pic_title\n\t\t\t\tFROM " . ALBUM_COMMENT_WATCH_TABLE . " cw, " . USERS_TABLE . " u\n\t\t\t\tLEFT JOIN " . ALBUM_TABLE . " AS p ON p.pic_id = {$pic_id}\n\t\t\t\tWHERE cw.pic_id = {$pic_id}\n\t\t\t\t\tAND cw.user_id NOT IN (" . $user->data['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")\n\t\t\t\t\tAND cw.notify_status = " . COMMENT_WATCH_UN_NOTIFIED . "\n\t\t\t\t\tAND u.user_id = cw.user_id";
    $result = $db->sql_query($sql);
    $bcc_list_ary = array();
    if ($row = $db->sql_fetchrow($result)) {
        $pic_title = $row['pic_title'];
        // Sixty second limit
        @set_time_limit(60);
        do {
            if ($row['user_email'] != '') {
                $bcc_list_ary[$row['user_lang']][] = $row['user_email'];
            }
            $update_watched_sql .= $update_watched_sql != '' ? ', ' . $row['user_id'] : $row['user_id'];
        } while ($row = $db->sql_fetchrow($result));
        //
        // Let's do some checking to make sure that mass mail functions
        // are working in win32 versions of php.
        //
        if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) {
            $ini_val = @phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
            // We are running on windows, force delivery to use our smtp functions
            // since php's are broken by default
            $config['smtp_delivery'] = 1;
            $config['smtp_host'] = @$ini_val('SMTP');
        }
        if (sizeof($bcc_list_ary)) {
            include IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
            $emailer = new emailer();
            $server_url = create_server_url();
            $album_showpage_url = $server_url . 'album_showpage.' . PHP_EXT;
            @reset($bcc_list_ary);
            while (list($user_lang, $bcc_list) = each($bcc_list_ary)) {
                $emailer->use_template('album_comment_notify', $user_lang);
                for ($i = 0; $i < sizeof($bcc_list); $i++) {
                    $emailer->bcc($bcc_list[$i]);
                }
                // The Comment_notification lang string below will be used
                // if for some reason the mail template subject cannot be read
                // ... note it will not necessarily be in the posters own language!
                $emailer->set_subject($lang['Pic_comment_notification']);
                // This is a nasty kludge to remove the username var ... till translators update their templates
                $emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);
                $email_sig = create_signature($config['board_email_sig']);
                $emailer->assign_vars(array('EMAIL_SIG' => $email_sig, 'SITENAME' => $config['sitename'], 'PIC_TITLE' => $pic_title, 'U_PIC' => $album_showpage_url . '?pic_id=' . $pic_id, 'U_STOP_WATCHING_COMMENT' => $album_showpage_url . '?pic_id=' . $pic_id . '&unwatch=comment'));
                $emailer->send();
                $emailer->reset();
            }
        }
    }
    $db->sql_freeresult($result);
    if ($update_watched_sql != '') {
        $sql = "UPDATE " . ALBUM_COMMENT_WATCH_TABLE . "\n\t\t\tSET notify_status = " . COMMENT_WATCH_NOTIFIED . "\n\t\t\tWHERE pic_id = {$pic_id}\n\t\t\t\tAND user_id IN ({$update_watched_sql})";
        $db->sql_query($sql);
    }
}
开发者ID:GabrielAnca,项目名称:icy_phoenix,代码行数:66,代码来源:album_functions.php

示例5: _home

	public function _home() {
		global $config, $user, $cache;

		$user_id = request_var('uid', 0);

		if (_button() || $user_id)
		{
			$username = request_var('username', '');
			$user_email = request_var('user_email', '');

			if ($user_id) {
				$sql = 'SELECT *
					FROM _members
					WHERE user_id = ';
				$sql = sql_filter($sql, $user_id);
			} else if (!empty($username)) {
				$username = get_username_base($username);

				$sql = 'SELECT *
					FROM _members
					WHERE username_base = ?';
				$sql = sql_filter($sql, $username);
			} else {
				$sql = 'SELECT *
					FROM _members
					WHERE user_email = ?';
				$sql = sql_filter($sql, $user_email);
			}

			if (!$userdata = sql_fieldrow($sql)) {
				exit;
			}

			//
			$user_id = $userdata['user_id'];

			$sql = 'UPDATE _members SET user_type = ?
				WHERE user_id = ?';
			sql_query(sql_filter($sql, USER_NORMAL, $user_id));

			$sql = 'DELETE FROM _crypt_confirm WHERE crypt_code = ?
					AND crypt_userid = ?';
			sql_query(sql_filter($sql, $code, $user_id));

			$emailer = new emailer();

			$emailer->from('info');
			$emailer->use_template('user_welcome_confirm');
			$emailer->email_address($userdata['user_email']);

			$emailer->assign_vars(array(
				'USERNAME' => $userdata['username'])
			);
			$emailer->send();
			$emailer->reset();

			_pre('La cuenta de <strong>' . $userdata['username'] . '</strong> ha sido activada.', true);
		}

		$sql = 'SELECT *
			FROM _members
			WHERE user_type = 1
			ORDER BY username';
		$result = sql_rowset($sql);

		foreach ($result as $i => $row) {
			if (!$i) _style('list');

			_style('list.row', array(
				'LINK' => s_link($this->name, $row['user_id']),
				'USERNAME' => $row['username'],
				'EMAIL' => $row['user_email'],
				'DATE' => $row['user_regdate'],
				'IP' => $row['user_regip'])
			);
		}

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:79,代码来源:user_activate.php

示例6: trim

     }
     if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
         $script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
         $script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
         $server_name = trim($board_config['server_name']);
         $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
         $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
         include $phpbb_root_path . 'includes/emailer.' . $phpEx;
         $emailer = new emailer($board_config['smtp_delivery']);
         $emailer->from($board_config['board_email']);
         $emailer->replyto($board_config['board_email']);
         $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
         $emailer->email_address($to_userdata['user_email']);
         $emailer->set_subject($lang['Notification_subject']);
         $emailer->assign_vars(array('USERNAME' => stripslashes($to_username), 'SENDER_USERNAME' => htmlspecialchars($userdata['username']), 'PM_SUBJECT' => $privmsg_subject, 'PM_MESSAGE' => $message_text, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
         $emailer->send();
         $emailer->reset();
     }
 }
 /*
 $template->assign_vars(array(
 	'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">')
 );
 
 $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
 
 message_die(GENERAL_MESSAGE, $msg);
 */
 //-- mod : Instant Post Redirect ------------------------------------------------------------
 //-- add
 redirect(append_sid("privmsg.{$phpEx}?folder=inbox"));
开发者ID:Nekrofage,项目名称:FJR,代码行数:31,代码来源:privmsg.php

示例7: notification

 function notification($sender_id, $recipient_id, $recipient_email, $email_subject, $email_text, $use_bcc = false, $pm_subject = '', $recipient_username = '', $recipient_lang = '', $emty_email_template = false)
 {
     global $db, $config, $user, $lang;
     require IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
     $recipient_lang = empty($recipient_lang) ? $config['default_lang'] : $recipient_lang;
     // Let's do some checking to make sure that mass mail functions are working in win32 versions of php.
     if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) {
         // We are running on windows, force delivery to use our smtp functions since php's are broken by default
         $config['smtp_delivery'] = 1;
         $config['smtp_host'] = @ini_get('SMTP');
     }
     $emailer = new emailer();
     $emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
     $emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
     $emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
     $emailer->headers('X-AntiAbuse: User IP - ' . $user->ip);
     if ($use_bcc) {
         $emailer->to($config['board_email']);
         $emailer->bcc($recipient_email);
     } else {
         $emailer->to($recipient_email);
     }
     $emailer->set_subject($email_subject);
     if ($emty_email_template) {
         $emailer->use_template('admin_send_email', $recipient_lang);
         $emailer->assign_vars(array('SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_email'], 'MESSAGE' => $email_text));
     } else {
         $server_url = create_server_url();
         $privmsg_url = $server_url . CMS_PAGE_PRIVMSG;
         $recipient_username = empty($recipient_username) ? $lang['User'] : $recipient_username;
         $email_sig = create_signature($config['board_email_sig']);
         $emailer->use_template('privmsg_notify', $recipient_lang);
         $emailer->assign_vars(array('USERNAME' => $recipient_username, 'SITENAME' => $config['sitename'], 'EMAIL_SIG' => $email_sig, 'FROM' => $user->data['username'], 'DATE' => create_date($config['default_dateformat'], time(), $config['board_timezone']), 'SUBJECT' => $pm_subject, 'PRIV_MSG_TEXT' => $email_text, 'FROM_USERNAME' => $user->data['username'], 'U_INBOX' => $privmsg_url . '?folder=inbox'));
     }
     $emailer->send();
     $emailer->reset();
     return true;
 }
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:38,代码来源:class_pm.php

示例8: home

    public function home()
    {
        global $core, $user;
        $tree = $this->valid_tree();
        $v = $this->__(_array_keys(w('is_comment is_form'), 0));
        // Form posting enabled and form submitted
        if ($v['is_form'] && _button()) {
            if (!is_ghost()) {
                _fatal(405);
            }
            if (!$tree['tree_form']) {
                _fatal();
            }
            $sql_fields = 'SELECT form_alias, form_required, form_legend, form_regex, 
				FROM _form_fields
				WHERE form_tree = ?
				ORDER BY form_order';
            if (!($form = _rowset(sql_filter($sql_fields, $tree['tree_id']), 'form_alias'))) {
                $form = _rowset(sql_filter($sql_fields, 0), 'form_alias');
            }
            $form['secure'] = array('form_required' => 1, 'form_regex' => '^([a-zA-Z]+)$', 'form_alias' => 'secure', 'form_type' => 'text', 'form_legend' => _lang('XCF_LEGEND'));
            foreach ($form as $row) {
                $v = array_merge($v, $this->__(array($row['form_alias'])));
                if (!f($v[$row['form_alias']])) {
                    if ($row['form_required']) {
                        $this->_error(sprintf(_lang('E_COMMENT_FIELD_EMPTY'), $row['form_legend']), false);
                    }
                    continue;
                }
                if (f($row['form_regex']) && !preg_match('#' . $row['form_regex'] . '#is', $v[$row['form_alias']])) {
                    $this->_error(sprintf(_lang('E_COMMENT_FIELD_BAD'), $row['form_legend']), false);
                    if ($row['form_alias'] == 'secure') {
                        $v[$row['form_alias']] = '';
                    }
                }
            }
            require_once XFS . 'core/xcf.php';
            $xcf = new captcha();
            if ($xcf->check($v['secure']) === false) {
                $v['secure'] = '';
                $this->_error('#E_COMMENT_INVALID_CAPTCHA');
            }
            unset($xcf);
            require_once XFS . 'core/emailer.php';
            $emailer = new emailer();
            $emailer->set_decode(true);
            $emailer->format('plain');
            $emailer->from($v['address']);
            $emailer->set_subject(_rm_acute($v['subject']));
            $emailer->use_template('contact_email');
            if (f($core->v('default_email'))) {
                $tree['tree_form_email'] .= (f($tree['tree_form_email']) ? ';' : '') . $core->v('default_email');
            }
            $form_addresses = array_map('trim', array_unique(explode(';', $tree['tree_form_email'])));
            foreach ($form_addresses as $i => $address) {
                $row_f = !$i ? 'email_address' : 'cc';
                $emailer->{$row_f}($address);
            }
            unset($v['secure']);
            $content = w();
            foreach ($form as $row) {
                if (!f($v[$row['form_alias']])) {
                    continue;
                }
                $content[] = $row['form_legend'] . ":\n" . $v[$row['form_alias']];
            }
            $emailer->assign_vars(array('CONTENT' => implode("\n\n", $content), 'FORM_ARTICLE' => $tree['tree_subject']));
            $emailer->send();
            $emailer->reset();
            $response = array('lang' => _lang('FORM_SUCCESS'));
            $this->e(json_encode($response));
        }
        // Comment posting enabled and form submitted.
        if ($v['is_comment'] && _button()) {
            if (!$tree['tree_allow_comments']) {
                _fatal();
            }
            $cv = $this->__(w('comment_username comment_address comment_website comment_message comment_security'));
            $comment_time = time();
            if (!$user->v('is_member')) {
                foreach ($cv as $cv_k => $cv_v) {
                    if (!f($cv_v)) {
                        $this->error('E_COMMENT_FILL_FIELDS');
                        break;
                    }
                }
                if (!$this->errors()) {
                    $sql = 'SELECT comment_time
						FROM _comments
						WHERE comment_ip = ?
							AND comment_status = 0';
                    if ($row_flood = _fieldrow(sql_filter($sql, $user->ip))) {
                        if ($comment_time - $row_flood['comment_time'] < 30) {
                            $this->error('E_COMMENT_FLOOD_TIME');
                        }
                    }
                }
                // CAPTCHA verification
                require_once XFS . 'core/xcf.php';
                $xcf = new captcha();
//.........这里部分代码省略.........
开发者ID:nopticon,项目名称:noptc,代码行数:101,代码来源:_tree.php

示例9: main

    function main($action)
    {
        global $db, $config, $template, $images, $user, $lang;
        global $pafiledb_config, $debug;
        $file_id = request_var('file_id', 0);
        if (empty($file_id)) {
            message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
        }
        $sql = 'SELECT file_catid, file_name
			FROM ' . PA_FILES_TABLE . "\n\t\t\tWHERE file_id = {$file_id}";
        $result = $db->sql_query($sql);
        if (!($file_data = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
        }
        $db->sql_freeresult($result);
        if (!$this->auth[$file_data['file_catid']]['auth_email']) {
            if (!$user->data['session_logged_in']) {
                redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=dload.' . PHP_EXT . '&action=email&file_id=' . $file_id, true));
            }
            $message = sprintf($lang['Sorry_auth_email'], $this->auth[$file_data['file_catid']]['auth_email_type']);
            message_die(GENERAL_MESSAGE, $message);
        }
        if (isset($_POST['submit'])) {
            // session id check
            $sid = request_post_var('sid', '');
            if (empty($sid) || $sid != $user->data['session_id']) {
                message_die(GENERAL_ERROR, 'INVALID_SESSION');
            }
            $error = false;
            $femail = request_var('femail', '');
            if (!empty($femail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
                $user_email = $femail;
            } else {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
            }
            $username = request_var('fname', '', true);
            $sender_name = request_var('sname', '', true);
            //if (!$user->data['session_logged_in'] || ($user->data['session_logged_in'] && ($sender_name != $user->data['username'])))
            if (!$user->data['session_logged_in']) {
                // Mighty Gorgon: is this really needed?
                /*
                include(IP_ROOT_PATH . 'includes/functions_validate.' . PHP_EXT);
                $result = validate_username($sender_name);
                if ($result['error'])
                {
                	$error = true;
                	$error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg'];
                }
                */
            } else {
                $sender_name = $user->data['username'];
            }
            if (!$user->data['session_logged_in']) {
                $semail = request_var('semail', '');
                if (!empty($semail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
                    $sender_email = $semail;
                } else {
                    $error = true;
                    $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
                }
            } else {
                $sender_email = $user->data['user_email'];
            }
            $subject = request_var('subject', '', true);
            $subject = htmlspecialchars_decode($subject, ENT_COMPAT);
            if (empty($subject)) {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
            }
            $message = request_var('message', '', true);
            // We need to check if HTML emails are enabled so we can correctly escape content and linebreaks
            $message = !empty($config['html_email']) ? nl2br($message) : htmlspecialchars_decode($message, ENT_COMPAT);
            if (empty($message)) {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_message_email'] : $lang['Empty_message_email'];
            }
            if (!$error) {
                include IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
                $emailer = new emailer();
                $emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
                $emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                $emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                $emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
                $emailer->use_template('profile_send_email', $user_lang);
                $emailer->to($user_email);
                $emailer->from($sender_email);
                $emailer->replyto($sender_email);
                $emailer->set_subject($subject);
                $emailer->assign_vars(array('SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_email'], 'FROM_USERNAME' => $sender_name, 'TO_USERNAME' => $username, 'MESSAGE' => $message));
                $emailer->send();
                $emailer->reset();
                $message = $lang['Econf'] . '<br /><br />' . sprintf($lang['Click_return'], '<a href="' . append_sid('dload.' . PHP_EXT . '?action=file&amp;file_id=' . $file_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid(CMS_PAGE_HOME) . '">', '</a>');
                message_die(GENERAL_MESSAGE, $message);
            }
            if ($error) {
                message_die(GENERAL_MESSAGE, $error_msg);
            }
        }
        $this->generate_category_nav($file_data['file_catid']);
//.........这里部分代码省略.........
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:101,代码来源:pa_email.php

示例10: trim

                 message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
             }
             if ($board_config['email_enabled'] && $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
                 $script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
                 $script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
                 $server_name = trim($board_config['server_name']);
                 $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
                 $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
                 $emailer = new emailer($board_config['smtp_delivery']);
                 $emailer->from($board_config['board_email']);
                 $emailer->replyto($board_config['board_email']);
                 $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
                 $emailer->email_address($to_userdata['user_email']);
                 $emailer->set_subject($lang['Notification_subject']);
                 $emailer->assign_vars(array('USERNAME' => stripslashes($to_username), 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
                 if (!($emailer_result = $emailer->send(1))) {
                     message_die(GENERAL_ERROR, 'Failed sending email :: ' . $emailer_result, '', __LINE__, __FILE__);
                 }
                 $emailer->reset();
             }
             $pmer = new cash_user($userdata['user_id'], $userdata);
             $pmer->give_pm_amount();
         }
     }
     $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.{$phpEx}?folder=inbox") . '">'));
     $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.{$phpEx}?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
     message_die(GENERAL_MESSAGE, $msg);
 } else {
     if ($preview || $refresh || $error) {
         //
         // If we're previewing or refreshing then obtain the data
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:31,代码来源:privmsg.php

示例11: store_dc

	public function store_dc($mode, $to, $from, $subject, $message, $can_reply = true, $can_email = false) {
		global $user;

		if ($mode == 'reply') {
			$insert = array(
				'parent_id' => (int) $to['parent_id'],
				'privmsgs_type' => PRIVMSGS_NEW_MAIL,
				'privmsgs_from_userid' => (int) $from['user_id'],
				'privmsgs_to_userid' => (int) $to['user_id'],
			);
		} else {
			$insert = array(
				'privmsgs_type' => PRIVMSGS_NEW_MAIL,
				'privmsgs_subject' => $subject,
				'privmsgs_from_userid' => (int) $from['user_id'],
				'privmsgs_to_userid' => (int) $to['user_id']
			);
		}

		$insert += array(
			'privmsgs_date' => time(),
			'msg_ip' => $user->ip,
			'privmsgs_text' => $this->prepare($message),
			'msg_can_reply' => (int) $can_reply
		);

		$dc_id = sql_insert('dc', $insert);

		if ($mode == 'reply') {
			$sql = 'UPDATE _dc SET root_conv = root_conv + 1, last_msg_id = ?
				WHERE msg_id = ?';
			sql_query(sql_filter($sql, $dc_id, $to['msg_id']));

			$sql = 'UPDATE _dc SET msg_deleted = 0
				WHERE parent_id = ?';
			sql_query(sql_filter($sql, $to['parent_id']));

			$user->delete_unread(UH_NOTE, $to['parent_id']);
		} else {
			$sql = 'UPDATE _dc SET parent_id = ?, last_msg_id = ?
				WHERE msg_id = ?';
			sql_query(sql_filter($sql, $dc_id, $dc_id, $dc_id));
		}

		$user->save_unread(UH_NOTE, (($mode == 'reply') ? $to['parent_id'] : $dc_id), 0, $to['user_id']);

		//
		// Notify via email if user requires it
		//
		if ($mode == 'start' && $can_email && $user->d('user_email_dc')) {
			$emailer = new emailer();

			$emailer->from('info');
			$emailer->set_subject('Rock Republik: ' . $from['username'] . ' te ha enviado un mensaje');
			$emailer->use_template('dc_email');
			$emailer->email_address($to['user_email']);

			$dc_url = s_link('my dc read', $dc_id);

			$emailer->assign_vars(array(
				'USERNAME' => $to['username'],
				'SENT_BY' => $from['username'],
				'DC_URL' => $dc_url)
			);
			$emailer->send();
			$emailer->reset();
		}

		return $dc_id;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:70,代码来源:comments.php

示例12: _email

	public function _email() {
		if ($this->make) {
			return;
		}

		if (empty($this->data['email'])) {
			fatal_error();
		}

		if (!$this->auth['user']) {
			do_login();
		}

		global $user, $config;

		$error_msg = '';
		$subject = '';
		$message = '';
		$current_time = time();

		if (_button()) {
			$subject = request_var('subject', '');
			$message = request_var('message', '', true);

			if (empty($subject) || empty($message)) {
				$error_msg .= (($error_msg != '') ? '<br />' : '') . lang('fields_empty');
			}

			if (empty($error_msg)) {
				$sql = 'UPDATE _artists SET last_email = ?, last_email_user = ?
					WHERE ub = ?';
				sql_query(sql_filter($sql, $current_time, $user->d('user_id'), $this->data['ub']));

				$emailer = new emailer($config['smtp_delivery']);

				$emailer->from($user->d('user_email'));

				$email_headers = 'X-AntiAbuse: User_id - ' . $user->d('user_id') . nr();
				$email_headers .= 'X-AntiAbuse: Username - ' . $user->d('username') . nr();
				$email_headers .= 'X-AntiAbuse: User IP - ' . $user->ip . nr();

				$emailer->use_template('mmg_send_email', $config['default_lang']);
				$emailer->email_address($this->data['email']);
				$emailer->set_subject($subject);
				$emailer->extra_headers($email_headers);

				$emailer->assign_vars(array(
					'SITENAME' => $config['sitename'],
					'BOARD_EMAIL' => $config['board_email'],
					'FROM_USERNAME' => $user->d('username'),
					'UB_NAME' => $this->data['name'],
					'MESSAGE' => $message
				));
				$emailer->send();
				$emailer->reset();

				redirect(s_link('a', $this->data['subdomain']));
			}
		}

		if ($error_msg != '') {
			_style('error');
		}

		v_style(array(
			'ERROR_MESSAGE' => $error_msg,

			'SUBJECT' => $subject,
			'MESSAGE' => $message)
		);

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:73,代码来源:artists.php

示例13: adr_send_pm

function adr_send_pm($dest_user, $subject, $message, $check_from_id = '')
{
    global $db, $phpbb_root_path, $phpEx, $lang, $user_ip, $board_config, $userdata;
    $dest_user = intval($dest_user);
    $msg_time = time();
    $from_id = $check_from_id === '' ? intval($userdata['user_id']) : $check_from_id;
    $html_on = 1;
    $bbcode_on = 1;
    $smilies_on = 1;
    include_once $phpbb_root_path . 'includes/functions_post.' . $phpEx;
    include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
    $privmsg_subject = trim(strip_tags($subject));
    $bbcode_uid = make_bbcode_uid();
    $privmsg_message = trim(strip_tags($message));
    // APM compliance
    if (defined('PRIVMSGA_TABLE')) {
        include_once $phpbb_root_path . 'includes/functions_messages.' . $phpEx;
        send_pm(0, '', $dest_user, $privmsg_subject, $privmsg_message, '');
    } else {
        $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active\r\n\t\t\t FROM " . USERS_TABLE . "\r\n\t\t\t WHERE user_id = {$dest_user} ";
        if (!($result = $db->sql_query($sql))) {
            $error = TRUE;
            $error_msg = $lang['No_such_user'];
        }
        $to_userdata = $db->sql_fetchrow($result);
        $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time\r\n\t\t\tFROM " . PRIVMSGS_TABLE . "\r\n\t\t\tWHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "\r\n\t\t\t  OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " \r\n\t\t\t\tOR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )\r\n\t\t\tAND privmsgs_to_userid = {$dest_user} ";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_MESSAGE, $lang['No_such_user']);
        }
        $sql_priority = SQL_LAYER == 'mysql' ? 'LOW_PRIORITY' : '';
        if ($inbox_info = $db->sql_fetchrow($result)) {
            if ($inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs']) {
                $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . "\r\n\t\t\t\t\tWHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "\r\n\t\t\t\t\tOR privmsgs_type = " . PRIVMSGS_READ_MAIL . "\r\n\t\t\t\t\tOR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )\r\n\t\t\t\t\tAND privmsgs_date = " . $inbox_info['oldest_post_time'] . "\r\n\t\t\t\t\tAND privmsgs_to_userid = {$dest_user} ";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql);
                }
                $old_privmsgs_id = $db->sql_fetchrow($result);
                $old_privmsgs_id = $old_privmsgs_id['privmsgs_id'];
                $sql = "DELETE {$sql_priority} FROM " . PRIVMSGS_TABLE . "\r\n\t\t\t\t\tWHERE privmsgs_id = {$old_privmsgs_id}";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)' . $sql, '', __LINE__, __FILE__, $sql);
                }
                $sql = "DELETE {$sql_priority} FROM " . PRIVMSGS_TEXT_TABLE . "\r\n\t\t\t\t\tWHERE privmsgs_text_id = {$old_privmsgs_id}";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql);
                }
            }
        }
        $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " \r\n\t\t\t(privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies)\r\n\t\t\tVALUES ( 1 , '" . str_replace("\\'", "''", addslashes($privmsg_subject)) . "' , " . $from_id . ", " . $to_userdata['user_id'] . ", {$msg_time}, '{$user_ip}' , {$html_on}, {$bbcode_on}, {$smilies_on})";
        if (!$db->sql_query($sql_info)) {
            message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql_info);
        }
        $privmsg_sent_id = $db->sql_nextid();
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)\r\n\t\t\tVALUES ({$privmsg_sent_id}, '" . $bbcode_uid . "', '" . str_replace("\\'", "''", addslashes($privmsg_message)) . "')";
        if (!$db->sql_query($sql, END_TRANSACTION)) {
            message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql);
        }
        $sql = "UPDATE " . USERS_TABLE . "\r\n\t\t\tSET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " \r\n\t\t\tWHERE user_id = " . $to_userdata['user_id'];
        if (!($status = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
        }
        if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
            // have the mail sender infos
            $script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
            $script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
            $server_name = trim($board_config['server_name']);
            $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
            $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
            include_once $phpbb_root_path . './includes/emailer.' . $phpEx;
            $emailer = new emailer($board_config['smtp_delivery']);
            if ($board_config['version'] == '.0.5' || $board_config['version'] == '.0.6' || $board_config['version'] == '.0.7' || $board_config['version'] == '.0.8' || $board_config['version'] == '.0.9') {
                $emailer->from($board_config['board_email']);
                $emailer->replyto($board_config['board_email']);
                $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
            } else {
                $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";
                $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
                $emailer->extra_headers($email_headers);
            }
            $emailer->email_address($to_userdata['user_email']);
            $emailer->set_subject($lang['Notification_subject']);
            $emailer->assign_vars(array('USERNAME' => $to_username, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
            $emailer->send();
            $emailer->reset();
        }
    }
    return;
}
开发者ID:Nekrofage,项目名称:FJR,代码行数:88,代码来源:adr_functions_communicate.php

示例14: emailer

    $emailer = new emailer($board_config['smtp_delivery']);
    $emailer->from(EMAIL_ADMIN);
    $emailer->replyto(EMAIL_ADMIN);
    for ($i = 0; $i < count($bcc_list); $i++) {
        $emailer->bcc($bcc_list[$i]);
    }
    $email_headers = 'X-AntiAbuse: Board servername - Asterisk 2 billing\\n';
    $email_headers .= 'X-AntiAbuse: User_id - 1\\n';
    $email_headers .= 'X-AntiAbuse: Username - Areski\\n';
    $email_headers .= 'X-AntiAbuse: User IP - 192.168.1.241\\n';
    $emailer->use_template($message);
    $emailer->email_address(EMAIL_ADMIN);
    $emailer->set_subject($subject);
    $emailer->extra_headers($email_headers);
    $emailer->assign_vars(array('SITENAME' => 'a2billing', 'BOARD_EMAIL' => EMAIL_ADMIN, 'MESSAGE' => 'Hey it is a message, just to watch working'));
    $result = $emailer->send();
    $emailer->reset();
}
// #### HEADER SECTION
$smarty->display('main.tpl');
echo $CC_help_mass_mail;
if (!isset($submit)) {
    ?>
<script language="JavaScript" src="javascript/card.js"></script>
<div class="toggle_hide2show">
<center><a href="#" target="_self" class="toggle_menu"><img class="toggle_hide2show" src="<?php 
    echo KICON_PATH;
    ?>
/toggle_hide2show.png" onmouseover="this.style.cursor='hand';" HEIGHT="16"> <font class="fontstyle_002"><?php 
    echo gettext("SEARCH CUSTOMERS");
    ?>
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_mass_mail.php

示例15: array

    function _form_home()
    {
        global $core, $user, $style;
        $tree = $this->valid_tree();
        if (!$tree['tree_form']) {
            _fatal();
        }
        if ($tree['tree_parent']) {
            $sql = 'SELECT *
				FROM _tree
				WHERE tree_id = ' . (int) $tree['tree_parent'];
            $parent = $this->_fieldrow($sql);
            if ($tree['tree_level'] > 2) {
                $sql = 'SELECT *
					FROM _tree
					WHERE tree_id = ' . (int) $parent['tree_parent'];
                $subparent = $this->_fieldrow($sql);
            }
        }
        if ($tree['tree_node']) {
            $sql = 'SELECT *
				FROM _tree
				WHERE tree_id = ' . (int) $tree['tree_node'];
            $node = $this->_fieldrow($sql);
        }
        //
        $sql = 'SELECT *
			FROM _form_fields
			WHERE form_tree = ' . (int) $tree['tree_id'] . '
			ORDER BY form_order';
        $form = $this->_rowset($sql, 'form_alias');
        if (!count($form)) {
            $sql = 'SELECT *
				FROM _form_fields
				WHERE form_tree = 0
				ORDER BY form_order';
            $form = $this->_rowset($sql, 'form_alias');
        }
        $form['ctkey'] = array('form_required' => 1, 'form_regex' => '^([a-zA-Z]+)$', 'form_alias' => 'ctkey', 'form_type' => 'text', 'form_legend' => 'Imagen de seguridad');
        if (_button()) {
            $va = array();
            foreach ($form as $row) {
                $va[] = $row['form_alias'];
            }
            $v = $this->__($va);
            foreach ($form as $row) {
                if (empty($v[$row['form_alias']])) {
                    if ($row['form_required']) {
                        $this->error(sprintf(_lang('E_COMMENT_FIELD_EMPTY'), $row['form_legend']), false);
                    }
                    continue;
                }
                if (!empty($row['form_regex']) && !preg_match('#' . $row['form_regex'] . '#is', $v[$row['form_alias']])) {
                    $this->error(sprintf(_lang('E_COMMENT_FIELD_BAD'), $row['form_legend']), false);
                    if ($row['form_alias'] == 'ctkey') {
                        $v[$row['form_alias']] = '';
                    }
                }
            }
            if (!$this->errors()) {
                include XFS . 'core/xcf.php';
                $xcf = new captcha();
                if ($xcf->check($v['ctkey']) === false) {
                    $v['ctkey'] = '';
                    $this->error('E_COMMENT_INVALID_CAPTCHA');
                }
                unset($xcf);
            }
            if (!$this->errors()) {
                include XFS . 'core/emailer.php';
                $emailer = new emailer();
                $v['subject'] = preg_replace('#\\&([A-Za-z]+){1}(.*?)\\;#e', "substr('\\1', 0, 1)", $v['subject']);
                $emailer->from($v['email']);
                $emailer->set_subject($v['subject']);
                $emailer->use_template('contact_email', $core->v('default_lang'));
                foreach (explode(';', $tree['tree_form_email']) as $i => $address) {
                    $row_f = !$i ? 'email_address' : 'cc';
                    $emailer->{$row_f}($address);
                }
                $emailer->cc($core->v('default_email'));
                unset($v['ctkey']);
                $html = array();
                foreach ($form as $row) {
                    if (empty($v[$row['form_alias']])) {
                        continue;
                    }
                    if ($row['form_alias'] == 'message') {
                        $v['message'] = str_replace("\r\n", '<br />', $v['message']);
                    }
                    $html[] = '<strong>' . $row['form_legend'] . ':</strong><br />' . $v[$row['form_alias']];
                }
                $emailer->assign_vars(array('HTML_FIELDS' => implode('<br /><br />', $html), 'FROM_USERNAME' => $v['nombre'], 'FORM_ARTICLE' => $tree['tree_subject']));
                $emailer->send();
                $emailer->reset();
                //
                $style->assign_block_vars('sent', array('THANKS' => _lang('CONTACT_THANKS')));
            }
        }
        if (!_button() || $this->errors()) {
            if ($this->errors()) {
//.........这里部分代码省略.........
开发者ID:nopticon,项目名称:noptc,代码行数:101,代码来源:_tree.php


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